> ## Documentation Index
> Fetch the complete documentation index at: https://ps365.clidsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get ExRoleReport

## SYNOPSIS

Reports on Exchange RBAC roles and their effective membership, including groups expanded recursively.

## SYNTAX

```powershell theme={null}
Get-ExRoleReport [[-Identity] <String>] [[-PrincipalID] <String>] [[-PrincipalDisplayName] <String>] [-OnPrem]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION

Produces a report of the membership of Exchange RBAC role groups.
By default, the report contains only the roles that have at least one member.

When a role member is itself a group (distribution group, mail-enabled security group,
dynamic distribution group, or a nested role group), its members are resolved recursively
and included in the report with DirectMember set to \$false and MemberViaGroup set to the
name of the group that is a direct member of the role.
Circular group references are
detected and skipped automatically.

## EXAMPLES

### EXAMPLE 1

```powershell theme={null}
Get-ExRoleReport
```

Retrieves the Exchange RBAC role report for Exchange Online, including recursive group expansion.

### EXAMPLE 2

```powershell theme={null}
Get-ExRoleReport -Identity 'Organization Management'
```

Returns only the membership of the 'Organization Management' role group.

### EXAMPLE 3

```powershell theme={null}
Get-ExRoleReport -PrincipalID 'alice@contoso.com'
```

Returns every role assignment held by [alice@contoso.com](mailto:alice@contoso.com) (direct or via group membership).

### EXAMPLE 4

```powershell theme={null}
Get-ExRoleReport -PrincipalDisplayName 'Alice Doe'
```

Returns every role assignment held by the user whose DisplayName is 'Alice Doe'.

### EXAMPLE 5

```powershell theme={null}
Get-ExRoleReport | Where-Object { $_.DirectMember -eq $false } | Format-Table Role, MemberName, MemberViaGroup
```

Lists all users/objects resolved through group membership, showing which group is a direct member of the role.

### EXAMPLE 6

```powershell theme={null}
Get-ExRoleReport | Export-Csv -NoTypeInformation "$(Get-Date -Format yyyyMMdd)_adminRoles.csv" -Encoding UTF8
```

Exports the full report (including group-expanded members) to a CSV file.

## PARAMETERS

### -Identity

Filter the report on a specific role (matches the Role column, exact case-insensitive).

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PrincipalID

Filter the report on a specific principal.
Matches MemberName (alias), MemberPrimarySMTPAddres (UPN/SMTP),
or MemberObjectID (ExternalDirectoryObjectId / GUID).

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PrincipalDisplayName

Filter the report on a specific MemberDisplayName (exact, case-insensitive).

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -OnPrem

When specified, queries an on-premises Exchange server instead of Exchange Online.
Group expansion is also performed for on-premises role groups.

```yaml theme={null}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### \[System.Collections.Generic.List\[Object]] containing PSCustomObject rows with the following properties:

### Role, MemberName, MemberDisplayName, MemberPrimarySMTPAddres, MemberIsDirSynced,

### MemberObjectID, MemberRecipientTypeDetails, RoleDescription, DirectMember, MemberViaGroup.

## NOTES

Requires ExchangeOnlineManagement module and an active Connect-ExchangeOnline session for Exchange Online.
For on-premises Exchange, requires the Exchange Management Shell or the Exchange snap-in loaded.

## RELATED LINKS

[https://ps365.clidsys.com/docs/commands/Get-ExRoleReport](https://ps365.clidsys.com/docs/commands/Get-ExRoleReport)
