Don’t do that: The following command retrieves all the properties for a user although only the property “PasswordLastSet” is required:
Get-ADUser -Identity $user -Properties * | Select-Object -Property PasswordLastSet
Do that: It’s better and faster to retrieve only the property “PasswordLastSet” (we only need this one).
With very large queries, the difference between “-Properties *” and “-Properties PasswordLastSet” can make a significant difference.
(Get-ADUser -Identity $user -Properties PasswordLastSet).PasswordLastSet