Forum Discussion
Omer_Faheem
May 09, 2023Copper Contributor
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 us...
tabouzid
Sep 02, 2023Copper Contributor
Enabling "Create a link to view and edit user OneDrive files" via PowerShell:
- Connect to Microsoft 365 PowerShell: Open PowerShell as an administrator and connect to your Microsoft 365 tenant using the Connect-MsolService command.
- 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:
- 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.
- 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"
}