Forum Discussion

Omer_Faheem's avatar
Omer_Faheem
Copper Contributor
May 09, 2023

How to enable "Create a link to view and edit ‎user ‎OneDrive‎ files" of all MS365 users on Azure

How to enable "Create a link to view and edit ‎user ‎OneDrive‎ files" for all users in bulk through the shell?

 

We also want a particular user account to access the one drive shared link of all users as that account will post multiple files on users' shared drive on a daily basis.

 

Kindly advise how to give a particular user read/write access to all users' one drive shared link.

1 Reply

  • tabouzid's avatar
    tabouzid
    Copper Contributor

    Omer_Faheem 

    Enabling "Create a link to view and edit user OneDrive files" via PowerShell:

    1. Connect to Microsoft 365 PowerShell: Open PowerShell as an administrator and connect to your Microsoft 365 tenant using the Connect-MsolService command.
    2. Generate Shared Links: Use the Set-SPOSite cmdlet. as below :

    Connect-SPOService -Url https://Yourtenantname-admin.sharepoint.com
    $users = Get-SPOUser -Site https://Yourtenantname-my.sharepoint.com/personal
    foreach ($user in $users) {

    Set-SPOSite -Identity $user.LoginName -SharingCapability ExternalUserAndGuestSharing

    }

     Granting a particular user read/write access to all OneDrive shared links:

    1. Add User to SharePoint Group: Log in to the SharePoint admin center and create a custom SharePoint group . Add the particular user account to this group.
    2. Provide Group Permissions: Grant the custom SharePoint group read/write permissions to all users' OneDrive shared links. as blow:

    Connect-SPOService -Url https://Yourtenantname-admin.sharepoint.com
    $users = Get-SPOUser -Site https://Yourtenantname-my.sharepoint.com/personal
    foreach ($user in $users) {


    Grant-SPOUser -Site $user.LoginName -LoginName "email address removed for privacy reasons" -Group "Custom Group Name" -Permissions "Edit"

    }

Resources