This article is part of a series of articles on the Quest Active Roles Management Shell and the CmdLets that are included in that.
The Get-QADUser CmdLet from Quest Tools can be used to return attributes back from your AD directory on a specific user object and place them in the local memory cache. The object returned by the CmdLet contains a pre-defined set of attributes. You can view or modify this default attribute set using the Get- or Set-QADPSSnapinSettings CmdLet. You can also change the returned attribute set on the returned object on an Ad-Hoc basis by using the -ExcludedProperties and -IncludedProperties parameters with the Get-QADUser CmdLet. One final option is the -IncludeAllProperties parameter, with this you can return all attributes of the user object and access them through the returned object in the memory cache.
The default attributes accessible in the returned object can be found here on page 39 in the “Quest Active Roles Management Shell for AD” guide.
Or enter this at the command line(With the Quest snap-in loaded)
Get-QADUser -Name accountname | Get-Member -MemberType Properties
To obtain all available attributes for a user object in your AD directory using the -IncludeAllProperties parameter.
Get-QADUser -Name accountname -IncludeAllProperties | Get-Member -MemberType Properties
Note: The above command will include all properties available in your AD directory in the returned user object, however when outputting the results to the cmdline the default attribute set controlled by the Get- or Set-QADPSSnapinSettings will prevail.
To see all user object attribute values
Get-QADUser -Name accountname -IncludeAllProperties | Format-List *
Export them to a .csv file
Get-QADUser -Name accountname -IncludeAllProperties | Export-CSV "C:\Scripts\UserDump.csv"
Including all properties(attributes) when you do not need them can add time to your executing code. I find it wise to minimize the data being queried and returned back whenever possible.
Using the above examples you can start to complete more complex user object queries.
I would like to search for a user based on their SMTP address (.mail attribute) and then retrieve their set mailbox limits. The SMTP address or mail attribute is a standard attribute we can filter on using the -Email parameter. See here o n page 34 of the “Quest Active Roles Management Shell for AD” guide. The required returned object attribute of .mDBUseDefaults, .mDBStorageQuota and .mDBOoverQuotaLimit are not attributes cached by default in the returned object. To gain these attributes you need to include them in the returned object and specify them in the output pipe.
Get-QADUser -Email 'email@example.com' -IncludedProperties mDBUseDefaults','mDBStorageQuota','mDBOoverQuotaLimit' | Format-List name,displayname,mDBUseDefaults,mDBStorageQuota,mDBOoverQuotaLimit
From this you should get back all the details of the user object specified in the Format-List command.
Hope this helps.
All information is provided on an AS-IS basis, with no warranties and confers no rights.