Powershell script to replace usergroup in SPO

Hi,

I’m new here so sorry if I posted this wrong or maybe for the 100th time.

The usergroup “Visitors” in SPO contain a modified AAD group named “AllusersexceptABmembers”, is there a way to use a script or command within PowerShell to replace this group with the group “AllenabledAzureUsers”. If not I have to manually replace this within around 700 SPO sites.

Thnx.

Have you done any research? There are many factors such as SharePoint versions. A quick search ‘powershell sharepoint group members update’ you can get plenty of links to review such as:

https://docs.microsoft.com/en-us/microsoft-365/enterprise/manage-sharepoint-users-and-groups-with-powershell?view=o365-worldwide

Replace would basically be a Remove of the old group and Add of the new group.