Restore the OneDrive Sharing settings in Microsoft 365 admin center
- eslameslam463
- Jan 2
- 2 min read

Symptoms
When users select the user details in the Microsoft 365 admin center, the OneDrive Sharing option is no longer available to them.
Cause
This problem occurs if a user navigates to User details > OneDrive > Sharing section > Manage external sharing and clears the Let people outside your organization access your site check box.
Resolution
To restore the OneDrive Sharing option, follow these steps:
Find the user MySite URL. For example:
https://m365x328152-my.sharepoint.com/personal/meganb_m365x328152_contoso_com
Run the following commands in the SharePoint Online Management Shell:
PowerShellCopy
Connect-SPOService -Url https://m365x328152-admin.sharepoint.com/ Set-SPOSite -Identity https://m365x328152-my.sharepoint.com/personal/meganb_m365x328152_contoso_com -SharingCapability ExternalUserSharingOnly
Note
In these commands, replace the URLs with the actual site URLs.
How to find the user's MySite URL
Option 1
Go to the Microsoft 365 admin center.
Select Active user > Account details > OneDrive.
Under Get access to files, select Create link to files to see the user's MySite URL.
Option 2
Sign in to the SharePoint Online admin center, and then select More features.
Under User profiles, select Open.
Search for and select the user profile.
Select the arrow at the end of the Account name, and then select Manage Personal Site to go to the user's OneDrive site.
Option 3
Use the following PnP PowerShell command to obtain the OneDrive URL of the user:
Start PowerShell.
In the command window, run the following commands:
PowerShellCopy
#Set Config Parameters $AdminSiteURL="https://<tenantName>-admin.sharepoint.com" $UserAccount="<userUPN@domain.com>" #UPN #Connect to the site Connect-PnPOnline $AdminSiteURL -Credentials (Get-Credential) #powershell to get onedrive for business url Get-PnPUserProfileProperty -Account $UserAccount | Select PersonalUrl
Have a question or need help! Contact me 😊❤️
Comments