June 2017
Beginner to intermediate
742 pages
18h 29m
English
In order to create a user object in Active Directory, we can use the New-ADUser cmdlet in PowerShell. You can view the full syntax of the command along with the accepted data types using this command:
Get-Command New-ADUser -Syntax
In order to create a new user account using PowerShell, the minimum value you need to pass is -Name. It will create a disabled user account, and you can define values for other attributes later.
This is an example that can be used to create a user account:
New-ADUser -Name "Talib Idris" -GivenName "Talib" -Surname "Idris" -SamAccountName "tidris" -UserPrincipalName "tidris@rebeladmin.com" -Path "OU=Users,OU=Europe,DC=rebeladmin,DC=com" -AccountPassword(Read-Host -AsSecureString "Type Password ...