Hi
I like out-GridView. It rocks my world.
What I'm trying to do is list sub-OUs of an OU, which I can do like this:
Powershell
dir|Out-GridViewBut within this OU there are a couple of objects that aren't OUs. I don't want to see them. I've tried various versions of using where:
Powershell
dir|where{$_.ObjectClass-eorganizationalUnit}Or...
Powershell
dir|where{$_.ObjectClass-e"organizationalUnit"}But to no avail. The first gives out this:
Text
At line:1 char:29 + dir | where {$_.ObjectClass -e organizationalUnit} + ~~ Unexpected token '-e' in expression or statement. At line:1 char:32 + dir | where {$_.ObjectClass -e organizationalUnit} + ~~~~~~~~~~~~~~~~~~ Unexpected token 'organizationalUnit' in expression or statement. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId :...