August 2019
Intermediate to advanced
786 pages
20h 22m
English
In order to create a user object in AD, we can use the New-ADUser PowerShell cmdlet. You can view the full syntax of the command along with the accepted data types using the following 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.
Here 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 for ...