Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Create OU in Active Directory

$
0
0

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

Hey, Scripting Guy! Question How can I use Windows PowerShell to create a new organizational unit (OU) in Active Directory?

Hey, Scripting Guy! Answer Use the New-ADOrganizationalUnit cmdlet, and specify the name and path. A description is optional.
           If you want to easily delete the OU later, set the ProtectedFromAccidentalDeletion flag to false.
           Note The following command is a one-line command that accomplishes this:

New-ADOrganizationalUnit -Name Charlotte -Path "dc=nwtraders,dc=com"
-Description "Charlotte office users" -ProtectedFromAccidentalDeletion:$false


Viewing all articles
Browse latest Browse all 3333

Trending Articles