PowerShell Get-ADGroup

Prompt for user input and query the Active Directory group for list of membership and nested membership.

        $ADGroup= Read-Host "Active Directory Group"
        
        $ADDomain = Read-Host "Enter Domain"
        
        Try{
        
           Get-ADGroupMember "$ADGroup" -Server $ADDomain -ErrorAction Stop -Recursive | select Name, SamAccountName |`
           
           Export-CSV C:\Temp\$ADGroupName"_"$ADGroupDomain".csv" -NoTypeInformation
        
           Invoke-item C:\Temp\$ADGroupName"_"$ADGroupDomain".csv"
            
        }Catch{
        
                Write-Host $_.Exception.Message
        
       }
       

Get-ADgroup | Extended Properties

Query Active Directory for a list specifc list of properties on the Domain Admins group.

 #Get AD Group information that is not in the default list - Notes and Description         
Get-ADGroup "Domain Admins" -Properties * | Select Info, description 

Get-ADgroup | Like Name

Query Active Directory for a list of groups with a name starting with App

Get-ADGroup -filter {Name -like "App*"} -Properties Description, info | Select Name, Description,info

2020 | Scott W. Head  |  Sr. Systems Admin | Certified Microsoft Windows Server Administrator