8 Unified user creation
This chapter covers:
- Using conditional logic to call a function.
- Using Exchange cmdlets on any PC in your domain utilizing PSSessions.
- Creating unique usernames to prevent duplicates
- Unifying several scripts to create a user, email and default groups with a few questions.
- Testing and optimizing your searches.
Up until now we have dealt with scripts that do very specific things. They might help us create an email address, create a user, or transfer group memberships. Each of these scripts are useful in their own right, but we’re interested in automation. Why not create one script that does all of these things?
As we have seen, each of these scripts are a time savings in themselves. It can take several minutes to create an Active Directory user by hand. It can take dozens of clicks to duplicate group membership from one user to another. Each of these scripts deserves a place in our ecosystem of scripts. But one of the core concepts of automation is doing more with less. If we could integrate some of the things we’ve done and weave them into a coherent script that did all of those things; that would save us even more! Here we can create a unified user creation script.
This script will: