Remove-EntraUser

Removes a user.

Syntax

Remove-EntraUser
      -UserId <String>
      [<CommonParameters>]

Description

The Remove-EntraUser cmdlet removes a user in Microsoft Entra ID. Specify the UserId parameter to remove the specified user in Microsoft Entra ID.

The calling user must be assigned at least one of the following Microsoft Entra roles:

  • User Administrator

  • Privileged Authentication Administrator

Examples

Example 1: Remove a user

Connect-Entra -Scopes 'User.ReadWrite.All'
Remove-EntraUser -UserId 'SawyerM@Contoso.com'

This command removes the specified user in Microsoft Entra ID.

Parameters

-UserId

Specifies the ID of a user (as a UPN or UserId) in Microsoft Entra ID.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False