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
Powershell , Excel charts and data presentation - SQL Server DBA
Powershell – adding multiple worksheets to Excel ... - SQL Server DBA
Export-CSV Powershell - SQL Server DBA
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |