Skip to content

aad user remove

Removes a specific user

Usage

m365 aad user remove [options]

Options

--id [id]
The ID of the user. Specify either id or userName but not both.
--userName [userName]
User principal name of the user. Specify either id or userName but not both.
--confirm
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 is full.
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text,csv,md. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Remarks

Important

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.

Important

To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator.

Note

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 aad user remove --id a33bd401-9117-4e0e-bb7b-3f61c1539e10

Removes a specific user by its UPN

m365 aad user remove --userName john.doe@contoso.com

Response

The command won't return a response on success.