Get-ADUser not returning all possible AD attributes when specifying all properties

前端 未结 2 2081
旧巷少年郎
旧巷少年郎 2020-12-31 18:41

I\'ve run into a case where specific properties are not enumerated when using
Get-ADUser -Properties *. For example the following code does not list the

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 19:28

    After doing some research, there are multiple types of attributes on an ADObject - Default, Extended, and Constructed are some examples of these.

    Default properties are returned on all ADObject queries matching a specific type of ADObject (ADUser has its own set of default properties, ADGroup has it's own set, etc.)

    Extended properties are not returned by default but are implicitly enumerable static attributes on an ADObject.

    Constructed attributes are not static properties but are calculated based on the values of other attributes belonging to an ADObject. I could not find any info on this, but I imagine that enumerating all Constructed attributes can be an expensive operation since the values are computed, and as such need to be explicitly requested via the -Properties parameter of the Get-ADObject cmdlets.

    This all seems to be related to the systemFlags attribute on an ADObject, which is where the attribute types are set. From my testing, attributes with either the Constructed (4) or Non-Replicated (2) flag need to be explicitly specified to be returned from the RSAT cmdlets.

    Sources

    msDS-UserPasswordExpiryTimeComputed Documentation

    List All Constructed Attributes on ADObject using an LDAP Filter

    Determining an Attribute Type

    SystemFlags Attribute

提交回复
热议问题