You can create an AD user in a specific OU by using the -path parameter in New-ADuser. The following example will create a user in the students OU of the pel.com domain.

New-ADUser -Name “Karim Buzdar" -GivenName Karim -Surname Buzdar -SamAccountName kbuzdar -UserPrincipalName kbuzdar@pel.com -path "OU=students, DC=pel, DC=com
PowerShell: How to Create an AD User in a Specific OU

One thought on “PowerShell: How to Create an AD User in a Specific OU

  • Permalink

    Thanks from your notes, but i have one question if we have a nesting OU so how we can add user in nested OU using powershell.

    Ex: NewYork (Main OU) and there is another OU inside NewYork(Users)
    so how we can add user in Users (OU) suing Powershell.

    Hameedullah

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*