(This post providesinformation on how you can use Management Shell for AD from Quest Software todo various management tasks for your Active Directory. For a quick introductioninto Management Shell for AD, please refer to: http://powergui.org/thread.jspa?threadID=2700&tstart=0) If you havemore then 1000 users in your AD domain, the Get-QADUser will not display themall. There is a default limit on items to display in Get-QAD* results and thelimit is 1000. To display all objects in AD, use -SizeLimit parameter (or -slas alias): To countobjects, use Measure-Object built-in cmdlet: PSC:\> Get-QADUser -sl 1000000 | Measure-Object Count : 4325 Average : Sum : Maximum : Minimum : Property: So, we havetotal 4325 user accounts in domain. It mighttake some time to execute this, as PowerShell first load all users from AD,then count them. To display countonly, use Format-Table or Format-List built-in cmdlet and select required propertyfrom the pipe. We will use Format-List for more friendly presentation: PSC:\> Get-QADUser -sl 1000000 | Measure-Object | Format-List Count Count: 4325 Now let'scount groups: PSC:\> Get-QADGroup -sl 1000000 | Measure-Object | Format-List Count Count: 3948 To countobjects of any type, use Get-QADObject cmdlet. Let's count OUs: PS C:\>Get-QADObject -sl 100000 -type organizationalUnit | Measure-Object |Format-List Count Count : 135
|