How to Export Active Directory Group Members with Powershell Get-ADGroupMember

26 June,2014 by Jack Vamvas

Question: How can I export Active Directory Group members? Also, if there are sub-groups , how can I view the sub group members?

Answer:  To access the Active Directory through Powershell,  an efficient method  is to install the  Active Directory Module for Powershell .

The Get-ADGroupMember module gets the Active Directory Group members

 

Import-Module ActiveDirectory
Get-ADGroupMember -identity “Group name” | select name | Export-csv -path C:\ADGroupmembers.csv –NoTypeInformation

 

If there are nested groups , within the group you’re checking , then use the –recursive parameter.

The –recursive parameter will enable an iteration of all the nested groups  , reporting on the members. The nested group members are added to the result list

 

Get-ADGroupMember -identity “Group name” -recursive | select name | Export-csv -path C:\ADGroupmembers.csv –NoTypeInformation


Read More

Powershell , Excel charts and data presentation - SQL Server DBA

Powershell – adding multiple worksheets to Excel ... - SQL Server DBA

Export-CSV Powershell - SQL Server DBA

 

 

 


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to Export Active Directory Group Members with Powershell Get-ADGroupMember


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer