Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

filter from powershell output

$
0
0

hi,

this is my coomand line to get ad username

 

get-aduser -Identity test -Properties * | select directreports | % { $_.directreports | % { $_.split(",")[0].replace("CN=","")}}

output

test-admin

test-user

test-user1

test-user2

 

my question what can i add in to last in this line show it shows me only name which contain -admin in output

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles