I’m about to start building a PS script to create new user accounts. We’re a small company (about 100 users), so bulk creation isn’t a requirement.
My approach has been to work out how to do one thing at a time, in the shell, to get the code, then paste that in to a file (in Notepad++, though I’m seriously considering using ISE). It all seems to be coming together nicely.
The driving force for this is because the old VB script, which I also wrote, is loooooong (about 2,000 lines, although some lines are redundant functions) and difficult to support. i.e. if there’s any kind of change, I have to edit the script, then test, then make it available. Also, since we moved to Exchange 2007, it no longer creates the user mailbox.
With Powershell, I’m instead going to use template AD User Account objects (one per dept), as a basis for the new user’s account. This way, since the changes I usually have to do to the script are things like office address, standard groups, and so on, changes can instead be made to the template accounts without requiring any script editing and testing.
So far my experience with PS suggests the end script will be more like 100 lines long. Nice one.
That’s a pretty long preamble to my question! My question is, should I go ahead and build a single script for this, OR, should I build lots of little scripts that each do a small part of the process then have a controller script that calls them one by one? I mean, I hear Don Jones argument (towards the end of this video: Don Jones Toolmaking Part 1 3 - YouTube) about using a controller script as small scripts are easier to maintain, but I wouldn’t have thought that this script would be particularly big anyway.