October 29th, 2013

PowerTip: Create an Organizational Unit with PowerShell

Doctor Scripto
Scripter

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”

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.