Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 1.21 KB

Remove-UserFromEntraIdRole.md

File metadata and controls

42 lines (26 loc) · 1.21 KB

Remove-UserFromEntraIdRole.ps1

Description

Remove a user's active or eligible assignment to an Entra ID role.

Parameters

UserId

The ID of the user in Entra ID.

RoleName

The name of the directory role. If not provided, it will default to all directory roles.

Examples

Example 1

Removes the user's assignment from the "User Administrator" directory role.

PS > Remove-UserFromEntraIdRole.ps1 -UserId "jwinger@greendalecc.edu" -GroupId "User Administrator"

Example 2

Removes the user's assignment from any directory role.

PS > Remove-UserFromEntraIdRole.ps1 -UserId "jwinger@greendalecc.edu"

Required Modules

Module Name Module Version
Microsoft.Graph.Authentication 2.17.0 <=
Microsoft.Graph.Groups 2.17.0 <=
Microsoft.Graph.Users 2.17.0 <=
Microsoft.Graph.Beta.Identity.Governance 2.17.0 <=