I've run into a case where specific properties are not enumerated when usingGet-ADUser -Properties *
. For example the following code does not list themsDS-UserPasswordExpiryTimeComputed
property even though it exists and I can specify it as a-Properties
argument, have it return, and can process its value.
# Does not return msDS-UserPasswordExpiryTimeComputed
Get-ADUser username -Properties *
# This works to get the msDS-UserPasswordExpiryTimeComputed attribute returned
Get-ADUser username -Properties msDS-UserPasswordExpiryTimeComputed
# If I really want all properties and this one
# I have to specify it alongside *
Get-ADUser username -Properties *, msDS-UserPasswordExpiryTimeComputed
This isn't just a case of the property being omitted from the display, I need to explicitly state the msDS-UserPasswordExpiryTimeComputed
property or else it simply isn't available on the resulting object.
I already know filtering on Properties *
isn't a good idea in most cases, but I'm curious about why all AD DS attributes are not enumerated when this is precisely what I am asking the cmdlet to do.
This question is asking about Get-ADUser
but like most other behaviors with the Get-ADObject
cmdlets I assume this behavior extends to most, if not all, of them.
-Properties *
, thanks for thatGet-ADObject username -Properties *
is there any difference?Get-ADObject
instead of 113 when usingGet-ADUser
(both specifying-Properties *
. So I get even less information by default. Also,Get-ADObject username
didn't work for me (errored withCannot find an object with identity
), so I filtered on mySamAccountName
as a test.