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

FilterBased on Extended Attributes (employeeNumber) and Dispaly sAMAccountName

$
0
0

I have a list of employee numbers and want to get sAMAccoutName and use those in a script to terminate accounts. Below is what I managed to put together but it does not give me what I want. Any help would be greatly appreciated.

Get-QADUser -DontUseDefaultIncludedProperties -IncludedProperties sAMAccountName -LdapFilter "(&(objectCategory=person)(objectClass=user)(employeeNumber=00014772))"

Name                       Type            DN
----                           ----              --
Doe, John                user            CN=Doe\, John,OU=USR,OU=USMD1,OU=US,OU=Regions,OU=Accounts,DC=m...

Instead of it displaying "Doe, John", I want it to display "DoeJ"

Thank you


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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