In Active Directory administration we can execute various configurations through the command line. This time we will teach how to create user accounts through PowerShell with the Active Directory module previously installed.

It should be noted that this process can be carried out very simply using the ADUC (Active Directory Users and Computers) MMC graphical add-in.

For the example to be carried out, we will create a domain account called ULTRON with the following cmdlet:

  • New-ADUser ULTRON:Executing this command the user “ULTRON” will be created in the Active Directory organizational unit called Users with default settings and at the same time the account will be disabled.

To create the domain account with more personalized parameters, enable the account and password when logging into the domain, we will proceed to execute the following command:

  • New-ADUser -Name “ULTRON” -Description “Ing. Telecommunications” -Enabled $true -AccountPassword $PASSWORD “Test123”

Likewise, the account will be created in the Active Directory organizational unit called Users.

And to proceed add the created user to an existing Active Directory group we will execute the following command:

  • Add-ADGroupMember -Identity “Domain Admins” -Member ULTRON

With this command, the ULTRON user account is added to the domain Admins group.

 

Oscar Cantos