Monday, January 30, 2023

Get AD Group info using PowerShell

 

Here's a PowerShell command that will help get a few of the properties you need from an Active Directory group, filtered by the name with a wildcard. it outputs a table of groups that match the filter clause.

Import-Module ActiveDirectory
Get-ADGroup -Filter "name -like 'GroupNameGoesHere-*'" -Properties * | Select-Object cn,  @{Label = "Manager";Expression = {%{(Get-AdUser $_.managedBy -Properties DisplayName).DisplayName}}}, description

Sources:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.