0

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!

0

Import Csv file with header using below command and you will get array.

Import-Csv

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.

  • Hi Anil,. thanks great! However I noticed that the Add-SPOUser command does not work for external users (i.e. adding a user with an external domain). How can I achieve this? – C.Moore Jul 3 '18 at 9:42
  • Moore, I am unsure that is there any such API is exposed by Microsoft. but you can use this link to bulk invite to external users. itgroove.net/mccalec/2016/01/19/… – Anil Pal Jul 3 '18 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.