connection use
Activate the specified Microsoft 365 tenant connection
Usage
m365 connection use [options]
Options
-n, --name [name]The name of the connection to switch to.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,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.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Remarks
If you haven't disabled the "prompt" setting, running this command without options will show a list of available connections. You can then select the connection to activate it.
You can update the name of a connection by running m365 connection set.
Examples
Switch to a different connection
m365 connection use --name '6e70c8ea-571d-4daf-bc48-9e1b49ac3390'
Switch to another connection by a custom connection name
m365 connection use --name 'myworkaccount'
Response
- JSON
- Text
- CSV
- Markdown
{
"connectedAs": "alexw@contoso.com",
"connectedName": "028de82d-7fd9-476e-a9fd-be9714280ff3",
"authType": "DeviceCode",
"appId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
"appTenant": "common",
"cloudType": "Public"
}
appId : 31359c7f-bd7e-475c-86db-fdb8c937548e
appTenant : common
authType : DeviceCode
cloudType : Public
connectionName : 028de82d-7fd9-476e-a9fd-be9714280ff3
connectedAs: alexw@contoso.com
connectionName,connectedAs,authType,appId,appTenant,cloudType
alexw@contoso.com,028de82d-7fd9-476e-a9fd-be9714280ff3,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public
# connection use
Date: 7/2/2023
Property | Value
---------|-------
connectedAs | alexw@contoso.com
connectionName | 028de82d-7fd9-476e-a9fd-be9714280ff3
authType | DeviceCode
appId | 31359c7f-bd7e-475c-86db-fdb8c937548e
appTenant | common
cloudType | Public