Skip to main 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:

CommandMerged with
spo site classic addspo site add
spo site classic listspo site list
spo site classic setspo 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:

AliasCommandReason
entra app deleteentra app removeRemoved to align with the naming convention.
entra app role deleteentra app role removeRemoved to align with the naming convention.
entra o365group restoreentra o365group recyclebinitem restoreRenamed to better match intention and naming convention.
outlook sendmailoutlook mail sendRenamed to better match intention and naming convention.
planner plan details getplanner plan getFunctionality merged in a single get-command.
planner task details getplanner task getFunctionality merged in a single get-command.
teams conversationmember addteams channel member addRenamed to better match intention and naming convention.
teams conversationmember listteams channel member listRenamed to better match intention and naming convention.
teams conversationmember removeteams channel member removeRenamed to better match intention and naming convention.
spo hubsite theme syncspo site hubsite theme syncRenamed to better match intention and naming convention.
spo hubsite connectspo site hubsite connectRenamed to better match intention and naming convention.
spo hubsite disconnectspo site hubsite disconnectRenamed 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:

OptionDescription
--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.
--bypassSharedLockThis 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 Entra groups as group member. Using spo group member better fits the intended situation of adding either users or Entra 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 --asAdmin, 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:

CommandOld optionNew option
entra approleassignment addobjectIdappObjectId
entra approleassignment adddisplayNameappDisplayName
entra approleassignment listobjectIdappObjectId
entra approleassignment listdisplayNameappDisplayName
entra approleassignment removeobjectIdappObjectId
entra approleassignment removedisplayNameappDisplayName
entra o365group addisPrivate [isPrivate]isPrivate (changed to flag)
entra o365group recyclebinitem listdisplayNamegroupDisplayName
entra o365group recyclebinitem listmailNicknamegroupMailNickname
entra o365group teamifygroupIdid
entra policy listpolicyTypetype
entra enterpriseapp getdisplayNameappDisplayName
entra enterpriseapp getobjectIdappObjectId
flow disableenvironmentenvironmentName
flow enableenvironmentenvironmentName
flow exportenvironmentenvironmentName
flow getenvironmentenvironmentName
flow listenvironmentenvironmentName
flow removeenvironmentenvironmentName
flow run cancelflowflowName
flow run cancelenvironmentenvironmentName
flow run getflowflowName
flow run getenvironmentenvironmentName
flow run listflowflowName
flow run listenvironmentenvironmentName
flow run resubmitflowflowName
flow run resubmitenvironmentenvironmentName
outlook message movemessageIdid
pa connector exportenvironmentenvironmentName
pa connector listenvironmentenvironmentName
pa solution reference addpathprojectPath
spfx package generatepackageNamename
spo app addscopeappCatalogScope
spo app deployscopeappCatalogScope
spo app getscopeappCatalogScope
spo app installscopeappCatalogScope
spo app listscopeappCatalogScope
spo app removescopeappCatalogScope
spo app retractscopeappCatalogScope
spo app uninstallscopeappCatalogScope
spo app upgradescopeappCatalogScope
spo apppage setpageNamename
spo cdn policy listtypecdnType
spo cdn policy settypecdnType
spo contenttype field setfieldIdid
spo customaction addurlwebUrl
spo customaction clearurlwebUrl
spo customaction geturlwebUrl
spo customaction listurlwebUrl
spo customaction removeurlwebUrl
spo customaction seturlwebUrl
spo feature disablefeatureIdid
spo feature disableurlwebUrl
spo feature enablefeatureIdid
spo feature enableurlwebUrl
spo feature listurlwebUrl
spo field getfieldTitletitle
spo field removefieldTitletitle
spo file checkinfileUrlurl
spo file checkoutfileUrlurl
spo file sharinginfo geturlfileUrl
spo file sharinginfo getidfileId
spo folder getfolderUrlurl
spo folder removefolderUrlurl
spo folder renamefolderUrlurl
spo site hubsite connecturlsiteUrl
spo site hubsite disconnecturlsiteUrl
spo hubsite registerurlsiteUrl
spo hubsite rights granturlhubSiteUrl
spo hubsite rights revokeurlhubSiteUrl
spo knowledgehub seturlsiteUrl
spo list contenttype addcontentTypeIdid
spo list contenttype removecontentTypeIdid
spo list view field addfieldIdid
spo list view field addfieldTitletitle
spo list view field addfieldPositionposition
spo list view field removefieldIdid
spo list view field removefieldTitletitle
spo list view field setfieldIdid
spo list view field setfieldTitletitle
spo list view field setfieldPositionposition
spo list view getviewIdid
spo list view getviewTitletitle
spo list view removeviewIdid
spo list view removeviewTitletitle
spo list view setviewIdid
spo list view setviewTitletitle
spo listitem listidlistId
spo listitem listtitlelistTitle
spo listitem record declareidlistItemId
spo listitem record undeclareidlistItemId
spo page column getnamepageName
spo page column listnamepageName
spo page control getnamepageName
spo page control listnamepageName
spo page control setnamepageName
spo page section addnamepageName
spo page section getnamepageName
spo page section listnamepageName
spo serviceprincipal grant revokegrantIdid
spo serviceprincipal permissionrequest approverequestIdid
spo serviceprincipal permissionrequest denyrequestIdid
spo site appcatalog addurlsiteUrl
spo site appcatalog removeurlsiteUrl
spo site apppermission getpermissionIdid
spo site apppermission removepermissionIdid
spo site apppermission setpermissionIdid
spo site chrome seturlsiteUrl
spo site groupifysiteUrlurl
spo site renamesiteUrlurl
spo sitedesign rights grantidsiteDesignId
spo sitedesign rights listidsiteDesignId
spo sitedesign rights revokeidsiteDesignId
spo sitedesign task gettaskIdid
spo sitedesign task removetaskIdid
spo tenant recyclebinitem removeurlsiteUrl
spo tenant recyclebinitem restoreurlsiteUrl
spo web addwebUrlurl
spo web getwebUrlurl
spo web listwebUrlurl
spo web reindexwebUrlurl
spo web removewebUrlurl
spo web setwebUrlurl
teams app app installappIdid
teams app app uninstallappIdid
teams channel getchannelIdid
teams channel getchannelNamename
teams channel removechannelIdid
teams channel removechannelNamename
teams channel setchannelNamename
teams message getmessageIdid
teams tab gettabIdid
teams tab gettabNamename
teams tab removetabIdid
teams team archiveteamIdid
teams team cloneteamIdid
teams team removeteamIdid
teams team setteamIdid
teams team unarchiveteamIdid
teams user app addappIdid
teams user app removeappIdid
viva connections app createappNamename
yammer group user addidgroupId
yammer group user adduserIdid
yammer group user removeidgroupId
yammer group user removeuserIdid
yammer message like setidmessageId
yammer user getuserIdid

What action do I need to take?

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

CTRL + M