Skip to content

Instantly share code, notes, and snippets.

@iqwirty
Created February 10, 2015 15:40
Show Gist options
  • Save iqwirty/2599e2e3d2597525448d to your computer and use it in GitHub Desktop.
Save iqwirty/2599e2e3d2597525448d to your computer and use it in GitHub Desktop.
Create a parent organizational unit and some children
# Create a parent organizational unit and some children
Import-Module ActiveDirectory
# Create the parent in dc=domain,dc=net
New-ADOrganizationalUnit "ParentOU"
# Create the children
1..10 | % `
{
New-ADOrganizationalUnit -Name "ChildOU$_" -Path "ou=ParentOU,dc=domain,dc=net"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment