PowerTip: Create an Organizational Unit with PowerShell

Summary: Use Windows PowerShell to create an organizational unit in Active Directory.

Hey, Scripting Guy! Question How can I use Windows PowerShell to create an OU in my Active Directory?

Hey, Scripting Guy! Answer In Windows Server 2012 R2 or Windows Server 2008 R2, use the New-ADOrganizationalUnit cmdlet.

To create a new OU at the root of Active Directory called “Divisions”:

NEW-ADOrganizationalUnit “Divisions”

If it needs to exist in different path in Active Directory, specify the path by its distinguished name:

NEW-ADOrganizationalUnit “Divisions” –path “OU=Offices,DC=Contoso,DC=local”