3 Create a user (the easy way)
This chapter covers:
- Using Read-Host for user supplied data
- Creating Menus with Read-Host and Write-Host
- PowerShell pipe mechanism
- Importing Modules
- Active Directory cmdlets New-ADUser and Get-ADUser
- Filtering AD Users with Where-Object
- Introduction to Race Conditions.
- Logging command history quickly and easily.
Adding users is a staple of a System Administrator’s world. The fact is, if there are not any users, there’s not really much point in having a system. Many systems have hundreds or even thousands of users. You can bet that nearly every one of them was created by a System Administrator. You can also bet that most of them were likely created by hand.
Most System Administrators view creating a user account as a rather trivial task, and by and large it is. But there are several required fields that make copy and pasting more than a little bit of a pain. Many companies, to save on onboarding costs typically have whole newhire classes. As such, it’s often that a System Administrator is not adding a single account, but often dozens at a time.
This usually involves: