List user objects and count them

List user objects and count them

There are several ways to list specific Active Directory objects. I will show you two ways : using the instance of the System.DirectoryServices.DirectoryEntry class or using the powershell cmdlet Get-ADObject

The interesting point is the performance between these methods. To check that we can use the powershell cmdlet Measure-Command . The result is :

You will find more information on the powershell cmdlet Measure-Command here:

Measures the time it takes to run script blocks and cmdlets.
Syntax
PowerShell

Measure-Command
[-Expression]
[-InputObject ]
[]

Description

The Measure-Command cmdlet runs a script block or cmdlet internally, times the execution of the operation, and returns the execution time.

<>

My Powershell script categories

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Social Media Auto Publish Powered By : XYZScripts.com
%d bloggers like this: