Forum Discussion
Block all personal sites in Sharepoint (Microsoft cannot help)
- Jan 19, 2021
You can use the Get-SPOSite cmdlet to list all "personal" sites:
$ODFBsites = Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'"
then loop over each site and change the state:
$ODFBsites | % {Set-SPOsite $_.Url -LockState NoAccess }
You can use the Get-SPOSite cmdlet to list all "personal" sites:
$ODFBsites = Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'"
then loop over each site and change the state:
$ODFBsites | % {Set-SPOsite $_.Url -LockState NoAccess }
Thank you very much.
Could you please answer one more question?
How can I check if the status changed? How can I list all sites LockState 😞
I just cannot make it work 😞
- VasilMichevJan 20, 2021MVP
For that, run the Get-SPOSite cmdlet with the -Detailed switch.
- F0RCEJan 24, 2021Copper Contributor
Unfortunately it was too hard to do for me.
Thanks for trying to help this useless piece of junk (me)