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 [email protected] -path "OU=students, DC=pel, DC=com
PowerShell: How to Create an AD User in a Specific OU
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

3 thoughts on “PowerShell: How to Create an AD User in a Specific OU

  • Avatar
    April 30, 2018 at 3:50 pm
    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
  • Avatar
    January 4, 2019 at 6:24 pm
    Permalink

    Simply put the distinguished name of NewYork’s user OU as the path

    ie
    -path “OU=Users , DC=NewYork, DC=MyCompany, DC=com”

    Reply
  • Avatar
    April 10, 2020 at 11:56 am
    Permalink

    Create a POWERSHELL SCRIPT for creating users “Followers” and “Violators” under OU “Lockdown”
    NOTE: The user and OU details have to be passed via an excel object.

    Reply

Leave a Reply

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

*