Group helpers
Requires EXO (for DGs/role groups) and Microsoft Graph for M365 groups where applicable. For complete, up-to-date info, run Get-Help <FunctionName> -Detailed.
Export-DistributionGroups
Export distribution groups and members.
Syntax
Export-DistributionGroups [-DistributionGroup <String[]>] [-Csv] [-CsvFolder <String>]
| Parameter | Description | Required | Default |
|---|---|---|---|
DistributionGroup | Group identity (name/alias/SMTP). Pipeline accepted. | No | All DGs |
Csv | Force CSV export. | No | False |
CsvFolder | Destination for CSV. | No | Current directory |
Example
Export-DistributionGroups -DistributionGroup "IT Team" -CsvFolder 'C:\Temp\DGs'
Export-DynamicDistributionGroups
Export dynamic DGs and evaluated members.
Syntax
Export-DynamicDistributionGroups [-DynamicDistributionGroup <String[]>] [-Csv] [-CsvFolder <String>]
| Parameter | Description | Required | Default |
|---|---|---|---|
DynamicDistributionGroup | Dynamic DG identity. Pipeline accepted. | No | All dynamic DGs |
Csv | Force CSV export. | No | False |
CsvFolder | Destination for CSV. | No | Current directory |
Example
Export-DynamicDistributionGroups -CsvFolder 'C:\Temp\DynDGs'
Get-DynamicDistributionGroupFilter
Show the simplified filter of a dynamic distribution group.
Syntax
Get-DynamicDistributionGroupFilter -DynamicDistributionGroup <String> [-IncludeDefaults] [-AsObject]
| Parameter | Description | Required |
|---|---|---|
DynamicDistributionGroup | Dynamic DG identity. Pipeline accepted. | Yes |
IncludeDefaults | Include default EXO filter clauses. | No |
AsObject | Return as object instead of string. | No |
Example
Get-DynamicDistributionGroupFilter -DynamicDistributionGroup "All Mailboxes"
Export-M365Group
Export Microsoft 365 groups (members/owners).
Syntax
Export-M365Group [-M365Group <String[]>] [-Csv] [-CsvFolder <String>]
| Parameter | Description | Required | Default |
|---|---|---|---|
M365Group | Group identity (name/alias/SMTP). Pipeline accepted. | No | All M365 groups |
Csv | Force CSV export. | No | False |
CsvFolder | Destination for CSV. | No | Current directory |
Example
Export-M365Group -M365Group "Project A" -CsvFolder 'C:\Temp\M365'
Get-RoleGroupsMembers
List Exchange Online role groups and members.
Syntax
Get-RoleGroupsMembers [-AsTable] [-GridView]
| Parameter | Description | Required | Default |
|---|---|---|---|
AsTable | Show formatted table output. | No | False (objects) |
GridView | Show results in Out-GridView. | No | False |
Example
Get-RoleGroupsMembers -AsTable
Get-UserGroups
Show the groups (DGs/M365) a user/contact/group belongs to.
Syntax
Get-UserGroups -UserPrincipalName <String> [-GridView]
| Parameter | Description | Required | Default |
|---|---|---|---|
UserPrincipalName | User/contact/group identity. | Yes | - |
GridView | Show details in Out-GridView. | No | False |
Example
Get-UserGroups -UserPrincipalName 'user@contoso.com'