Posts
read more
Adding organizational units to AD through powershell
Want to create some organizational structure in AD, I suppose it is specifically useful in a development environment, well the best solution is powershell then. Mastering Powershell by and Powershell.nu by Niklas Goude provide examples how to do this.
$domain = [ADSI]""
$ou = $domain.Create("organizationalUnit", "OU=Administration")
$ou.SetInfo()Be sure you write “organizationalUnit” in lower case. Otherwise you’ll get “Exception calling “SetInfo” with “0” argument(s): “The specified directory service attribute or value does not exist” when you invoke $ou.setinfo(). If you want to create an OU under another OU, just create $domain and specify the location: