Powershell get-aduser not showing all results

active-directorypowershellwindows-server-2012-r2

I'm trying to pull some data from AD but am getting some confusing results. I'm running:

Get-ADUser -Filter * -Properties * | select userPrincipalName, msTSLSProperty01

and it presents me with all users, 6 of which have something in the msTSLSProperty01 field. The confusing thing is that it should return 42 users with something in that field. Any reason it shows blank for users who have data in that field?

Edit 1: In addition, when I run:

Get-ADUser username -Properties msTSLSProperty01 | select msTSLSProperty01

it returns and empty set.

Best Answer

If you have multiple DCs in your environment, you may just be seeing replication delays if the changes you are expecting were only recently written to those user attributes. Powershell might be querying a different DC than whatever other tool you're using to verify those attributes exist. You can explicitly tell PowerShell to talk to a specific DC with the -Server argument in the Get-ADUser command.

Alternatively, you might have permissions issues preventing you from reading that attribute for a subset of your users.