Archive for June 28th, 2007

Get a list of ALL user properties

Learning something new every day. There was a question in the forums on PowerGUI.org today on obtaining a list of all attributes a user object has.

I used to think that the way to get the list of attributes exposed directly via PowerShell is to call:

PS:\> Get-QADUser | Get-Member

Or use a user as an example:

PS:\> Get-QADUser "Dmitry Sotnikov" | Format-List

And if you want to get to the more advanced AD properties (such as for example Msds-ResultantPSo in this example of managing fine-grained password policies) you are screwed and have to go to MSDN and read the AD schema docs.

As it turns out, this is not the case! You can get the full list of attributes available for a user object with this one call:

PS C:\> Get-QADUser -ReturnPropertyNamesOnly -IncludeAllProperties

objectClass
cn
instanceType
nTSecurityDescriptor
objectCategory
objectSid
sAMAccountName
...

Thanks to Rostislav for the tip!

In my network this gave 458 attributes so I am not providing the full output here.

See the whole thread here.

Tags: , , , , , , ,

UPDATE: Changed Format-Table to Format-List. Format-Table with no property names specified after it is more or less useless – it just gives the default output. Format-List by default lists all properties exposed directly via PowerShell with their values.

Advertisement

My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

June 2007
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

%d bloggers like this: