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
Sending
User Review
4.4 (5 votes)