Dear All,
I googled around today and use following script to get the account list from a specific OU where it contains many sub-OUs.
Get-ADObject -filter { mailNickname -like "" } -SearchBase $OUpath -Properties |
select samAccountName, mailNickName, mail, Name, DistinguishedName, UserPrincipalName |
Export-Csv -NoType $ExportPath
However, I found in the .csv that those users with mailNickName as "not set" status didn't get listed in the file. What I was trying to do is to list all the users in the OU with their respective attributes like mail, mailNickName, samAccountName, etc.
What am I missing? (There were star chars in the script but somehow they were not seen?)