entra user remove
Removes a specific user
Usage
m365 entra user remove [options]
Options
--id [id]
The ID of the user. Specify either
id
oruserName
but not both.--userName [userName]
User principal name of the user. Specify either
id
oruserName
but not both.-f, --force
Don't prompt for confirmation.
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
If the user with the specified id or user name doesn't exist, you will get a Resource 'xyz' does not exist or one of its queried reference-property objects are not present.
error.
To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator.
After running this command, it may take a minute before the user is effectively moved to the recycle bin.
Examples
Removes a specific user by id.
m365 entra user remove --id a33bd401-9117-4e0e-bb7b-3f61c1539e10
Removes a specific user by its UPN.
m365 entra user remove --userName john.doe@contoso.com
Response
The command won't return a response on success.