Skip to content

v6 Upgrade Guidance

The v6 of CLI for Microsoft 365 introduces several breaking changes. To help you upgrade to the latest version of CLI for Microsoft 365, we've listed those changes along with any actions you may need to take.

Consolidated SharePoint Online site commands

In CLI for Microsoft 365 we had several commands that were originally targeted at classic SharePoint sites. All functionality in these commands has been merged with the regular SharePoint site commands and deprecated as a result. They have therefore been removed in v6. The commands that were removed are:

Command Merged with
spo site classic add spo site add
spo site classic list spo site list
spo site classic set spo site set

To fix a resulting issue with the spo site list command, the default value of the type option of that command has been removed.

What action do I need to take?

Replace references to spo site classic * commands, with the respective spo site * command. The options have not changed and the output of the commands has not changed as well. After updating the references test your scripts as there might be slight differences in how the commands behave.

Removed the executeWithLimitedPermission option in the spo list list command

In version 5 of the CLI for Microsoft 365, the spo list list command could only be executed with site owner permissions. To update this without introducing a breaking change, we temporarily added the --executeWithLimitedPermission option to be able to execute it as a site visitor or member as well. In v6 we removed this option while changing the command in such a way that you do not need to be a site owner anymore.

What action do I need to take?

Remove the references to the executeWithLimitedPermission option in your scripts. Verify that your scripts work as intended with the new data structure returned by the spo list list command.

Removed deprecated aliases

We removed several aliases to align commands with our naming convention. The following aliases were removed:

Alias Command Reason
aad app delete aad app remove Removed to align with the naming convention.
aad app role delete aad app role remove Removed to align with the naming convention.
aad o365group restore aad o365group recyclebinitem restore Renamed to better match intention and naming convention.
outlook sendmail outlook mail send Renamed to better match intention and naming convention.
planner plan details get planner plan get Functionality merged in a single get-command.
planner task details get planner task get Functionality merged in a single get-command.
teams conversationmember add teams channel member add Renamed to better match intention and naming convention.
teams conversationmember list teams channel member list Renamed to better match intention and naming convention.
teams conversationmember remove teams channel member remove Renamed to better match intention and naming convention.
spo hubsite theme sync spo site hubsite theme sync Renamed to better match intention and naming convention.
spo hubsite connect spo site hubsite connect Renamed to better match intention and naming convention.
spo hubsite disconnect spo site hubsite disconnect Renamed to better match intention and naming convention.

What action do I need to take?

Replace any of the aliases mentioned above with the corresponding command name. The functionality of the command hasn't changed.

In planner commands, removed the deprecated planName option

In several planner commands we renamed the planName option to planTitle to align with the underlying API. Along with introducing the planTitle option, we deprecated the old planName option. In v6 of the CLI we removed the planName option. The following list of commands is affected by this change:

What action do I need to take?

Replace the reference to the --planName option with --planTitle.

Removed the deprecated autoOpenBrowserOnLogin configuration key

The CLI for Microsoft 365 contains commands that return a link that the user should copy and open in the browser. At first, this was only available in the login command. We introduced the autoOpenBrowserOnLogin configuration key was introduced to have the CLI automatically open the browser, so that you don't have to copy/paste the URL manually. As we introduced this functionality to other commands, we renamed this configuration key to autoOpenLinksInBrowser. In v6 of the CLI, we removed the deprecated autoOpenBrowserOnLogin key.

What action do I need to take?

If you have configured the autoOpenBrowserOnLogin key, you'll now need to configure the autoOpenLinksInBrowser key to keep the same behavior. You can do this by running the following script:

m365 cli config set --key autoOpenLinksInBrowser --value true

Updated spo file copy options

We updated the spo file copy command. The improved functionality support copying files larger than 2GB and specify the name for the copied file. To support these changes, we had to do several changes to the command's options. When you specify an URL for options webUrl, sourceUrl and targetUrl, make sure that you specify a decoded URL. Specifying an encoded URL will result in a File Not Found error. For example, /sites/IT/Shared%20Documents/Document.pdf will not work while /sites/IT/Shared Documents/Document.pdf will work just fine.

Because of this rework, we were able to add new options, but we also removed existing ones.

Removed options:

  • --deleteIfAlreadyExists
  • --allowSchemaMismatch

New options:

Option Description
--nameConflictBehavior [nameConflictBehavior] Behavior when a document with the same name is already present at the destination. Possible values: fail, replace, rename. Default is fail.
--newName [newName] New name of the destination file.
--bypassSharedLock This indicates whether a file with a share lock can still be copied. Use this option to copy a file that is locked.

What action do I need to take?

Update your scripts with the following:

  • Ensure all the URLs you provide are decoded.
  • Remove the option --allowSchemaMismatch.
  • Replace option --deleteIfAlreadyExists with --nameConflictBehavior replace.

In teams channel commands, changed short options

In the following commands we've changed some shorts:

The following shorts where changed:

  • Where we used -c, --id, we changed it to -i, --id.
  • Where we used -i, --teamId, we changed it to --teamId.

What action do I need to take?

Update the reference to the short options in your scripts.

Updated teams app publish command output

In the past versions, teams app publish returned just the app ID of the published app, or nothing at all. This has been adjusted, now the command will return the entire result object.

v5 JSON command output:

"fbdfd207-83ee-45d8-9c98-5039a1a01207"

v6 JSON command output:

{
    "id": "fbdfd207-83ee-45d8-9c98-5039a1a01207",
    "externalId": "b5561ec9-8cab-4aa3-8aa2-d8d7172e4311",
    "displayName": "Test App",
    "distributionMethod": "organization"
}

What action do I need to take?

Update your scripts to read the id property of the command output.

Updated spo eventreceiver get command output

In the past versions, spo eventreceiver get returned an array with a single object. This has been adjusted, now the command will only return the object.

v5 JSON command output:

[
  {
    "ReceiverAssembly": "Microsoft.Office.Server.UserProfiles, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c",
    "ReceiverClass": "Microsoft.Office.Server.UserProfiles.ContentFollowingWebEventReceiver",
    "ReceiverId": "c5a6444a-9c7f-4a0d-9e29-fc6fe30e34ec",
    "ReceiverName": "PnP Test Receiver",
    "SequenceNumber": 10000,
    "Synchronization": 2,
    "EventType": 10204,
    "ReceiverUrl": "https://northeurope1-0.pushnp.svc.ms/notifications?token=b4c0def2-a5ea-490a-bb85-c2e423b1384b"
  }
]

v6 JSON command output:

{
  "ReceiverAssembly": "Microsoft.Office.Server.UserProfiles, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c",
  "ReceiverClass": "Microsoft.Office.Server.UserProfiles.ContentFollowingWebEventReceiver",
  "ReceiverId": "c5a6444a-9c7f-4a0d-9e29-fc6fe30e34ec",
  "ReceiverName": "PnP Test Receiver",
  "SequenceNumber": 10000,
  "Synchronization": 2,
  "EventType": 10204,
  "ReceiverUrl": "https://northeurope1-0.pushnp.svc.ms/notifications?token=b4c0def2-a5ea-490a-bb85-c2e423b1384b"
}

What action do I need to take?

Update your scripts to expect a single object instead of an array.

Updated spo group user <verb> commands

We've renamed the spo group user <verb> commands to spo group member <verb> to better cover all possible scenarios. In the near future we'll be adding support to add Azure AD Groups as group member. Using spo group member better fits the intended situation of adding either users or Azure AD groups.

As a side issue, we've also updated the response output of the spo group member list command in JSON output mode. This returned a member array within a parent value object. In the new situation, the command returns the array without the parent value object.

What action do I need to take?

Update your scripts to use the new member noun instead of user. If you are using the output of spo group member list in JSON output mode, update your scripts and remove the value object.

Removed short notation for option asAdmin in pp commands

We've decided to remove all short notations for option --asAdmin in pp commands. In previous versions, many commands had the notation -a, --asAdmin. This has been changed to --adAdmin, we removed the short notation to align it with our naming convention.

Affected commands:

What action do I need to take?

Update your scripts to use --asAdmin instead of -a.

Updated teams app list command

The logic to list the installed apps in a specified team is moved to a new command teams team app list. As a result, the command teams app list only displays the installed apps from the Microsoft Teams app catalog. The command teams app list does no longer contain the options all, teamId and teamName. In addition, there is a new option for this command that allows you to indicate which installed apps from the Microsoft Teams app catalog you want to list according to the distribution method.

What action do I need to take?

Update your scripts to use the teams app list command if you want to list the installed apps in the Microsoft Teams app catalog. If you want to list the installed apps in a specified team, use the teams team app list command instead.

Aligned options with naming convention

As we've been adding more commands to the CLI, we noticed that several commands were using inconsistent options names. Our naming convention states that options that refer to the last noun in the command, don't need that noun as a prefix. for example: the option --webUrl for m365 spo web list has been renamed to --url as the last noun is web. In version 6 of the CLI for Microsoft 365, we updated all these options to be consistent and make it easier for you to use the CLI.

We've updated the following commands and options:

Command Old option New option
aad approleassignment add objectId appObjectId
aad approleassignment add displayName appDisplayName
aad approleassignment list objectId appObjectId
aad approleassignment list displayName appDisplayName
aad approleassignment remove objectId appObjectId
aad approleassignment remove displayName appDisplayName
aad o365group add isPrivate [isPrivate] isPrivate (changed to flag)
aad o365group recyclebinitem list displayName groupDisplayName
aad o365group recyclebinitem list mailNickname groupMailNickname
aad o365group teamify groupId id
aad policy list policyType type
aad sp get displayName appDisplayName
aad sp get objectId appObjectId
flow disable environment environmentName
flow enable environment environmentName
flow export environment environmentName
flow get environment environmentName
flow list environment environmentName
flow remove environment environmentName
flow run cancel flow flowName
flow run cancel environment environmentName
flow run get flow flowName
flow run get environment environmentName
flow run list flow flowName
flow run list environment environmentName
flow run resubmit flow flowName
flow run resubmit environment environmentName
outlook message move messageId id
pa connector export environment environmentName
pa connector list environment environmentName
pa solution reference add path projectPath
spfx package generate packageName name
spo app add scope appCatalogScope
spo app deploy scope appCatalogScope
spo app get scope appCatalogScope
spo app install scope appCatalogScope
spo app list scope appCatalogScope
spo app remove scope appCatalogScope
spo app retract scope appCatalogScope
spo app uninstall scope appCatalogScope
spo app upgrade scope appCatalogScope
spo apppage set pageName name
spo cdn policy list type cdnType
spo cdn policy set type cdnType
spo contenttype field set fieldId id
spo customaction add url webUrl
spo customaction clear url webUrl
spo customaction get url webUrl
spo customaction list url webUrl
spo customaction remove url webUrl
spo customaction set url webUrl
spo feature disable featureId id
spo feature disable url webUrl
spo feature enable featureId id
spo feature enable url webUrl
spo feature list url webUrl
spo field get fieldTitle title
spo field remove fieldTitle title
spo file checkin fileUrl url
spo file checkout fileUrl url
spo file sharinginfo get url fileUrl
spo file sharinginfo get id fileId
spo folder get folderUrl url
spo folder remove folderUrl url
spo folder rename folderUrl url
spo site hubsite connect url siteUrl
spo site hubsite disconnect url siteUrl
spo hubsite register url siteUrl
spo hubsite rights grant url hubSiteUrl
spo hubsite rights revoke url hubSiteUrl
spo knowledgehub set url siteUrl
spo list contenttype add contentTypeId id
spo list contenttype remove contentTypeId id
spo list view field add fieldId id
spo list view field add fieldTitle title
spo list view field add fieldPosition position
spo list view field remove fieldId id
spo list view field remove fieldTitle title
spo list view field set fieldId id
spo list view field set fieldTitle title
spo list view field set fieldPosition position
spo list view get viewId id
spo list view get viewTitle title
spo list view remove viewId id
spo list view remove viewTitle title
spo list view set viewId id
spo list view set viewTitle title
spo listitem list id listId
spo listitem list title listTitle
spo listitem record declare id listItemId
spo listitem record undeclare id listItemId
spo page column get name pageName
spo page column list name pageName
spo page control get name pageName
spo page control list name pageName
spo page control set name pageName
spo page section add name pageName
spo page section get name pageName
spo page section list name pageName
spo serviceprincipal grant revoke grantId id
spo serviceprincipal permissionrequest approve requestId id
spo serviceprincipal permissionrequest deny requestId id
spo site appcatalog add url siteUrl
spo site appcatalog remove url siteUrl
spo site apppermission get permissionId id
spo site apppermission remove permissionId id
spo site apppermission set permissionId id
spo site chrome set url siteUrl
spo site groupify siteUrl url
spo site rename siteUrl url
spo sitedesign rights grant id siteDesignId
spo sitedesign rights list id siteDesignId
spo sitedesign rights revoke id siteDesignId
spo sitedesign task get taskId id
spo sitedesign task remove taskId id
spo tenant recyclebinitem remove url siteUrl
spo tenant recyclebinitem restore url siteUrl
spo web add webUrl url
spo web get webUrl url
spo web list webUrl url
spo web reindex webUrl url
spo web remove webUrl url
spo web set webUrl url
teams app app install appId id
teams app app uninstall appId id
teams channel get channelId id
teams channel get channelName name
teams channel remove channelId id
teams channel remove channelName name
teams channel set channelName name
teams message get messageId id
teams tab get tabId id
teams tab get tabName name
teams tab remove tabId id
teams team archive teamId id
teams team clone teamId id
teams team remove teamId id
teams team set teamId id
teams team unarchive teamId id
teams user app add appId id
teams user app remove appId id
viva connections app create appName name
yammer group user add id groupId
yammer group user add userId id
yammer group user remove id groupId
yammer group user remove userId id
yammer message like set id messageId
yammer user get userId id

What action do I need to take?

If you use any of the commands listed above, ensure that you use the new option names.