Powershell: Retrieving all properties for a given user object

I was asked to provide an overview of all available properties in an Active Directory user object for an upcoming project. As it turns out, that is very easily accomplished. Unsurprisingly, PowerShell has an applet for this. We use the Get-ADUser applet, with the parameters Identity to identify the user in question and Properties with a wildcard to return all properties.

The query looks something like this: Get-ADUser -Filter %USER% -Properties *, and it will return each and every property. There are a lot of them, and it turned out that they only really wanted a few; user name, display name, company, department, last logon date, and manager.

Removing the wildcard, and adding the specific properties they were looking for, the query looked like this: Get-ADUser -Filter %USER% -Properties CN, DisplayName, Company, Department, LastLogonDate, Manager. By default, PowerShell returns a few other properties too, meaning that the result of the query looked like this:

Output of get-aduser command, filtering on identity and specific properties


Posted

in

by

Comments

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.