BULK add internal and guest users SharePoint groups
-
19-01-2021 - |
Pergunta
I have a requirement to 're-provision' SharePoint access for migrated users. At the moment I have an extract of users and the sites/groups they have access to, some of these users are internal and some are guest/external.
Has anyone found a way to bulk grant access? For example, Ideally I'd like to input the below in to SPO PowerShell via .csv and the script will grant access to the correct group.
Joe.Bloggs@test.com, https://spo.sharepoint.com/sites/Test, Test Members
Grant.Access@test.com, https://spo.sharepoint.com/sites/DEV, Dev Visitors
Any help appreciated!
Solução
Import Csv file with header using below command and you will get array.
You can loop this array and inside you can write below command.
Add-SPOUser -Site https://mytenant.sharepoint.com/sites/mysitecollection -Group "Group Name" -LoginName user@mytenant.onmicrosoft.com
I hope it will simplfy your work.
Use this example for reference.