Skip to content

spo user remove

Removes user from specific web


m365 spo user remove [options]


-u, --webUrl <webUrl>
URL of the web to remove user
--id [id]
ID of the user to remove from web
--loginName [loginName]
Login name of the site user to remove
Do not prompt for confirmation before removing user from web
-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 for more information and examples
-o, --output [output]
Output type. json,text,csv,md. Default json
Runs command with verbose logging
Runs command with debug logging


Use either id or loginName, but not both


Removes user with id 10 from web without prompting for confirmation

m365 spo user remove --webUrl "" --id 10 --confirm

Removes user with login name i:0#.f|membership| from web

m365 spo user remove --webUrl "" --loginName "i:0#.f|membership|"


The command won't return a response on success.

More information