Hi Tejas Mehta ,
I know this is very late , but this command is throwing Access Denied error intermittently. This behavior is observed since this morning .I am trying to Groupify sites in bulk and during implementation of this PS script i am encountered with this.
Group creation is successful. But it is not associated to SharePoint site. First thought it was a synching issue but waited for 4-5 hours , but still it is same.
The same functionality tried with PNP using "Add-PnPOffice365GroupToSite", but it is also having same issue ( guess the same API it is using internally )
Also in https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/set-spositeoffice365group?view=sharepoint-ps , it is mentioned that this command is still in preview and cannot be used for Prod.
This cmdlet is currently in preview and is subject to change. It is not currently supported for use in production environments.
So Do we have any alternative approaches to achieve this.
Thanks in advance !
Thanks
Purna Madugula