Quick AD Powershell help

Soldato
Joined
14 Mar 2004
Posts
8,040
Location
Brit in the USA
I'm trying to add a group to an OU that is within another OU. So far I have this:

New-ADGroup -name "HRGroup" -groupcategory Security -groupscope Global -path "OU=MainOU,OU=ChildOU,DC=DomainName,DC=com"

I get "Directory Object Not Found".

If I delete the child OU from the path it creates the group in the Main OU just fine.

How should the path read to get the group into the child OU?

Thanks!
 
Nevermind, worked it out. You have to specify the child OU before the parent in the path :rolleyes::)
 
Back
Top Bottom