Different ways of getting AD group members

I will show you, in the scripts below, different ways of getting Active Directorw group members with Powershell.

Scripts
ADSI method

Get-ADGroupMember cmdlet

Get-ADObject cmdlet

Performance

We can now compare the performance for each script with the Powershell cmdlet measure-command :

ADSI method

Get-ADGroupMember cmdlet

Get-ADObject cmdlet

The main difference between AD cmdlets and ADSI method is the loading of the Active Directory Powershell module. We can also measure the performance for it:

This loading time can be excluded from the previous results : the AD cmdlets are more efficient than the ADSI method. We can also optimize the loading of the Active Directory module by specifying only the needed cmdlets:

The results are quite explicit…

<>

References

Active Directory Service Interfaces
Active Directory Service Interfaces (ADSI) is a set of COM interfaces used to access the features of directory services from different network providers. ADSI is used in a distributed computing environment to present a single set of directory service interfaces for managing network resources. Administrators and developers can use ADSI services to enumerate and manage the resources in a directory service, no matter which network environment contains the resource.
ADSI enables common administrative tasks, such as adding new users, managing printers, and locating resources in a distributed computing environment.

ADSI Edit (adsiedit.msc)
Active Directory® Service Interfaces Editor (ADSI Edit) is a Lightweight Directory Access Protocol (LDAP) editor that you can use to manage objects and attributes in Active Directory. ADSI Edit (adsiedit.msc) provides a view of every object and attribute in an Active Directory forest. You can use ADSI Edit to query, view, and edit attributes that are not exposed through other Active Directory Microsoft Management Console (MMC) snap-ins: Active Directory Users and Computers, Active Directory Sites and Services, Active Directory Domains and Trusts, and Active Directory Schema.

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: