Need list of member from OU, but not the child OU's.
Posted on 2014-11-12
I have the syntax below to get all the members of the win7 OU. But there are other OU's in the Win7 OU and I do not want the member from them, just the members of the win7 ou. How can I modify my script to give me the just the members under win7 and not the other OU's?
Get-ADComputer -SearchBase 'OU=win7,OU=Workstations,OU=Machines,DC=global,DC=company,DC=com' -Filter '*' | Select -Exp Name > g:\win7.csv