SharePoint Online: Move Users from One Group to Another
Requirement: Move users from one group to another in SharePoint Online.
How to Move Users Between SharePoint Online Groups?
Well, there is no direct way to copy or move users between SharePoint Online groups. But you can achieve it by following below steps:
SharePoint Online: Move Users from One Group to Another using PowerShell
Here is how you can move users from one group to another in SharePoint Online:
How to Move Users Between SharePoint Online Groups?
Well, there is no direct way to copy or move users between SharePoint Online groups. But you can achieve it by following below steps:
- Click on Settings gear >> Site Settings
- Click on "People and Groups" under "Users and Permissions" group
- Select the Source group name from left navigation >> Select All Users by ticking the checkbox in the header >> Click on "E-mail Users" from "Actions" menu. This opens the default Email client with all users of the group. Copy them!
- Navigate to the destination group in SharePoint Online site>> Click on "Add users and paste those copied Email.
SharePoint Online: Move Users from One Group to Another using PowerShell
Here is how you can move users from one group to another in SharePoint Online:
#Config Variables $SiteURL = "https://crescent.sharepoint.com/sites/marketing" $SourceGroupName = "Marketing Team" $DestinationGroupName = "Marketing Managers" #Connect to PNP Online Connect-PnPOnline -Url $SiteURL -UseWebLogin #Get Members of the Source Group $SourceGroup = Get-PnPGroup -Identity $SourceGroupName | Select-Object Users #Add users to destination group Foreach ($User in $SourceGroup.Users) { #Frame User ID $UserID = "i:0#.f|membership|"+$User.Email #Add user to Group Add-PnPUserToGroup -LoginName $UserID -Identity $DestinationGroupName #Remove user from source group Remove-PnPUserFromGroup -LoginName $UserID -Identity $SourceGroupName Write-host "User Moved :"$User.Email }You can comment the "Remove-PnPUserFromGroup" (Line#20) to perform copy users between groups.
No comments:
Please Login and comment to get your questions answered!