# Get-MtRoleMember

Returns all the members of a role.

Source: https://maester.dev/docs/commands/Get-MtRoleMember

## SYNOPSIS

Returns all the members of a role.

## SYNTAX

### RoleName (Default)

```powershell
Get-MtRoleMember [-Role] <String[]> [-MemberStatus <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]
```

### RoleId

```powershell
Get-MtRoleMember [-RoleId] <Guid[]> [-MemberStatus <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]
```

## DESCRIPTION

The role can be either active or eligible, defaults to getting members that are both active and eligible.

If the assigned member is a group, all members of that group will be returned.
A group that is not found (404) is
skipped; any other error reading a group is thrown, so a check cannot pass without evaluating its members.

Results come from the session cache, so a second call in the same session returns the same members.
Run
Clear-MtGraphCache to read them again.

## EXAMPLES

### EXAMPLE 1

```powershell
Get-MtRoleMember -Role GlobalAdministrator
```

Returns all the Global Administrators and includes both Eligible and Active members.

### EXAMPLE 2

```powershell
Get-MtRoleMember -Role GlobalAdministrator -MemberStatus Active
```

Returns all the Global Administrators that are currently active and excludes those that are eligible but not yet active.

### EXAMPLE 3

```powershell
Get-MtRoleMember -Role GlobalAdministrator,PrivilegedRoleAdministrator
```

Returns all the Global Administrators and Privileged Role administrators and includes both Eligible and Active members.

### EXAMPLE 4

```powershell
Get-MtRoleMember -RoleId "00000000-0000-0000-0000-000000000000"
```

Returns all the members of the role with the specified RoleId and includes both Eligible and Active members.

### EXAMPLE 5

```powershell
Get-MtRoleMember -RoleId "00000000-0000-0000-0000-000000000000" -MemberStatus Active
```

Returns all the currently active members of the role with the specified RoleId.

## PARAMETERS

### -Role

The name of the role to get members for.

```yaml
Type: String[]
Parameter Sets: RoleName
Aliases:

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

### -RoleId

The ID of the role to get members for.

```yaml
Type: Guid[]
Parameter Sets: RoleId
Aliases:

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

### -MemberStatus

The type of members to look for.
Default is both Eligible and Active.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

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

### -ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
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

## NOTES

## RELATED LINKS

[https://maester.dev/docs/commands/Get-MtRoleMember](https://maester.dev/docs/commands/Get-MtRoleMember)
