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