PowerShell: List all Security Groups in AD

The below PowerShell code will get all Security Groups that are in the Domain and sort them by alphabetical order.

 

Display on Screen:
Get-ADGroup -filter {groupCategory -eq 'Security'} | Select Name | Sort-Object Name

Leave a Reply

Your email address will not be published. Required fields are marked *