Skip to content

spo serviceprincipal set

Enable or disable the service principal

Usage

m365 spo serviceprincipal set [options]

Alias

m365 spo sp set

Options

-e, --enabled <enabled>
Set to true to enable the service principal or to false to disable it. Valid values are true,false
--confirm
Don't prompt for confirming enabling/disabling the service principal
-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. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Remarks

Important

To use this command you must be a Global administrator.

Using the -e, --enabled option you can specify whether the service principal should be enabled or disabled. Use true to enable the service principal and false to disable it.

Examples

Enable the service principal. Will prompt for confirmation

m365 spo serviceprincipal set --enabled true

Disable the service principal. Will prompt for confirmation

m365 spo serviceprincipal set --enabled false

Enable the service principal without prompting for confirmation

m365 spo serviceprincipal set --enabled true --confirm