Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Get list of OUs then use in -Seachbase

$
0
0

Hello all,

There seems to be a couple of ways to obtain all OUs with "something" in their name - in my case I'm seaching for all OUs called "XP" and then my aim is to discover if these OUs contain any Windows 7 clients by mistake.

    Get-ADObject -Filter 'Name -like "XP"' | Select-Object DistinguishedName

this returns a list of all of our XP OUs. 

So I'd then like to send this result over to get-adcomputer and populate the -searchbase value with the values discovered above....the theory seemed simple but I'm not having much luck...

Any help appreciated, thanks

C


Carl Barrett | Twitter: @Mosquat


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>