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