AD- New user Command New-ADUser
Learn from:
Teacher Xu Peng's AD Powershell series of video courses
Create an enabled user:
Required attributes:
Name
SamAccountName
UserPrincipalName
DisplayName
Path
AccountPassword
New-ADUser-SamAccountName test01-Name test01-UserPrincipalName test01@satid.com-DisplayName "test01"-Path "ou=Lab,dc=satid,dc=com"-AccountPassword (ConverTo-SecureString "Abc@123"-AsPlainTest-Force)-Enabled $true
Create 10 users in batch
For {$user= "user" + $ispun updated username + "@ satid.com" New-ADUser-SamAccountName $user-Name $user-UserPrincipalName $upn-DisplayName $user-Path "ou=Lab,dc=satid,dc=com"-AccountPassword (ConverTo-SecureString "Abc@123"-AsPlainTest-Force)-Enabled $true}