Posts

Showing posts from February, 2014

Powershell: Get All AD Group Members

Purpose: This script requires the RSAT tools to work. It connects to AD and gets all groups and users within each group and outputs to a csv file. It can also get single groups and display/exports the results.


################################### #Tony Unger - Get Group members #12/12/2013 #1.0 ################################### Import-Module activedirectory do { cls $response = "N" $ExportPath = "c:\temp\AD_GroupMemberofQuery.csv" $myCol = @() [int]$xMenuChoiceA = 0 while ( $xMenuChoiceA -lt 1 -or $xMenuChoiceA -gt 4 ){ Write-host "Active Directory Group Member Reporting" -foregroundcolor "magenta" Write-host "1. Specifiy a Group" Write-host "2. All Groups" Write-host "3. Quit and exit" [Int]$xMenuChoiceA = read-host "Please enter an option 1 to 3..." } Switch( $xMenuChoiceA ){ 1{$ADGroups = read-host "Please enter the AD group name:"} 2{$ADGroups = Get-ADGroup -filter {GroupCategory -…