How admins can grant OneDrive access to bulk users in Microsoft 365?
+
When multiple users need access to OneDrive for cross-team collaborations or shared projects, administrators can use group-based access. They can grant access to multiple users in bulk to streamline management.
- Log in to the SharePoint admin center, go to the More features tab, and click Open under the User profiles category.
- Under the People tab, select Manage User Profiles.
- In the Find profiles text box, enter the name or User Principal Name (UPN) of the user whose OneDrive needs to be accessed by others, and click Find.
- On the search results, click the appropriate user and select Manage site collection owners from the dropdown.
- Add the users or group you want to grant access to in the Site Collection Administrators field and click OK.
- Then, choose the Manage Personal Site option for the corresponding user, which will redirect to their OneDrive page. From there, copy the site's URL and share it with the users assigned as the site collection administrators.
Note: Add site admins only to the Site Collection Administrators field. Avoid making any changes to the Primary Site Collection Administrator field, as it may result in the respective user losing access.
To grant OneDrive access, first connect to the SharePoint Online Management Shell using the below cmdlet.
Connect-SPOService -Url "<AdminCenterURL>"
Next, run the script below, replacing â<Target User's UPN>â with the UPN of the user whose OneDrive needs to be shared, and "<email@example.com>" with the site collection administrators to whom you want to grant access.
$targetSite = Get-SPOsite -IncludePersonalSite $true -Filter "Owner -eq <Target User's UPN>" | Where-Object { $_.Url -like "*/personal/*"}
$userEmails = @("<email1@example.com>", "<email1@example.com>")
foreach ($userEmail in $userEmails) {Set-SPOUser -Site $targetSite.Url -LoginName $userEmail -IsSiteCollectionAdmin $true}
Similarly, to revoke admin access to a user's OneDrive, execute the code snippet below.
$targetSite = Get-SPOsite -IncludePersonalSite $true -Filter "Owner -eq <Target User's UPN>" | Where-Object { $_.Url -like "*/personal/*"}
$userEmails = @("<email1@example.com>", "<email2@example.com>")
foreach ($userEmail in $userEmails) {Remove-SPOUser -Site $targetSite.Url -LoginName $userEmail}