Body
Audience
Staff
Overview
This document describes a script that can be used to obtain a list of detailed information from Pitt AD that provides specific group or information.
How to Get a List of Groups from AD User using PowerShell
Steps
To obtain a list of detailed information from Pitt AD that specifies specific group or information, modify the group name and properties for the script to obtain the desired results. Use the following scripts as a guide:
List of groups in Pitt AD for iTarget:
- SVC - GROUPNAME
- Common group names are:
- SVC - ConfluenceLDAP
- SVC - JiraLDAP
- SVC - WebAnalyticsLDAP
- SVC - Projects
- SVC - Personal
List of the common properties queried are:
To obtain a list of all groups for a particular user run the below command from power shell Administrator prompt (*** NOTE the user running the script must have rights within the AD department). This will also output the file to a .txt or .csv file on the users desktop.
For creating a text file:
Get-ADPrincipalGroupMembership job112 | select name | Out-File "C:\PowerShell_Files\User_Groups.txt"
OR
For creating a CSV file use:
Get-ADPrincipalGroupMembership job112 | select name | Export-CSV "C:\PowerShell_Files\User_Groups..csv" -NoTypeInformation -Encoding UTF8
Related Articles:
Article Summary:
This document describes a script that can be used to obtain a list of detailed information from Pitt AD that provides specific group or information.
Feedback and Concerns:
If you have any feedback regarding this article, please reach out to hsitkb@pitt.edu. You can also leave a comment below as well.