Creating new user accounts in Active Directory is pretty standard stuff, but doing it the traditional way requires a lot of mouse clicks. Since we know that PowerShell can be used to accomplish anything within Windows Server 2016, but not many people actually employ it regularly, let's use this common task as a recipe to be accomplished with PowerShell rather than the GUI.
We will use PowerShell on our Windows Server 2016 DC in order to create this new user account.
Follow along to create a new user account in Active Directory by using the PowerShell command prompt:
New-ADUser -Name "John Smith" -UserPrincipalName
"[email protected]" -SamAccountName "jsmith"
New-ADUser - Name "Jase Robertson" -UserPrincipalName
"[email protected]" - SamAccountName "jrobertson" -
GivenName "Jase" -Surname "Robertson" -DisplayName "Jase
Robertson" -AccountPassword (Read-Host -AsSecureString
"AccountPassword") -ChangePasswordAtLogon $true -Enabled $true
By using PowerShell, we are able to create new Active Directory user accounts right from a command interface, rather than logging into a server and launching the graphical interface in order to accomplish this common task. Can your New-ADUser
commands become extremely lengthy in order to populate all of the attributes you want to include? Yes. However, can saving and running a PowerShell script that utilizes New-ADUser
cmdlet save you time in the long run? Absolutely! It might take a few minutes of thought and testing in order to get your script to the point where it populates the information that you would like, but once you have created and saved that script, it can be modified and run quickly in the future in order to create new accounts. There is even a way to utilize the New-ADUser
cmdlet to copy properties from an existing user account while it sets up the new one, which may also help to save you some time and energy on new user account creations.
Make sure to check out the following TechNet link. This page lists all of the possible parameters and syntax that you might want to run alongside your New-ADUser
cmdlet script. There are a ton of options:
3.17.183.186