PowerShell: Default properties

Last week, when describing how to return specific properties, I mentioned that the command returns some standard properties, which is why I didn’t have to specify that it should get the Displayname for the members of the group. What properties are by default returned for the commonly used commands?

  • Get-ADComputer
    • DistinguishedName, DNSHostName, Enabled, Name, ObjectClass, ObjectGUID, SamAccountName SID, UserPrincipalName
  • Get-ADGroup
    • distinguishedName, GroupCategory, GroupScope, Name, ObjectClass, ObjectGUID, SamAccountName, SID
  • Get-ADGroupmember
    • distinguishedName, name, objectClass, ObjectGUID, SamAccontName, SID
  • Get-ADUser
    • DistinguishedName, Enabled, GivenName, Name, ObjectClass, ObjectGUID, SID, Surname, UserPrincipalName

I’ve already shown you how to get a specific property. If you want to find all properties, you simply append -property *. This is an excellent way to find out what properties you have to choose from, even though it might take a bit of time to plow through it to find the specific information you’re looking for.





By posting a comment, you consent to our collecting the information you enter. See privacy policy for more information.

This site uses Akismet to reduce spam. Learn how your comment data is processed.