Cannot change -LockState

%3CLINGO-SUB%20id%3D%22lingo-sub-2090202%22%20slang%3D%22en-US%22%3ECannot%20change%20-LockState%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2090202%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22s-prose%20js-post-body%22%3E%3CP%3EI%20have%20a%20problem%20with%20my%20Sharepoint%20Online%20instance.%20To%20prevent%20sharing%20files%20in%20Microsoft%20Teams%20I%20have%20locked%20all%20personal%20sites%20for%20my%20previous%20tenant%20domain.%20It%20works%20flawlessly%2C%20as%20people%20cannot%20use%20OneDrive%20anymore.%3C%2FP%3E%3CP%3EWe%20then%20used%20AD%20Connect%20to%20migrate%20all%20users%20from%20local%20AD.%20We%20took%20away%20right%20to%20create%20personal%20site%20with%20storage%20for%20everyone%2C%20so%20when%20user%20try%20to%20log%20in%20OneDrive%20he%20gets%20an%20error.%20It%20works%20-%20personal%20sites%20are%20not%20created.%3C%2FP%3E%3CP%3EBut%20before%20we%20took%20away%20create%20personal%20site%20right%20-%20we%20manually%20transfered%20two%20accounts.%20Now%20they%20are%20synchronized%20too.%20They%20had%20mysite%20tho%20I%20so%20blocked%20it%20toghether%20with%20the%20rest.%3C%2FP%3E%3CP%3EThe%20problem%20is%20that%20I%20cannot%20unlock%20this%20mysite%20anymore...%3C%2FP%3E%3CP%3ESet-SPOSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxxx-my.sharepoint.com%2Fpersonal%2Fxxx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fxxx-my.sharepoint.com%2Fpersonal%2Fxxx%3C%2FA%3E%22%20-LockState%20%22Unlock%22%20Does%20not%20work.%20It%20does%20not%20print%20any%20errors...%3C%2FP%3E%3CP%3EI%20use%20this%20to%20check%20status%3A%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3EForeach%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-variable%22%3E%24Site%3C%2FSPAN%3E%20in%20%3CSPAN%20class%3D%22hljs-variable%22%3E%24Sites%3C%2FSPAN%3E)%7B%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Write-Host%20%3CSPAN%20class%3D%22hljs-variable%22%3E%24Site%3C%2FSPAN%3E.Url%20%20%0A%20%20%20%20%20%20%20%20Write-Host%20%3CSPAN%20class%3D%22hljs-variable%22%3E%24Site%3C%2FSPAN%3E.LockState%0A%20%20%20%20%7D%0A%0A%3C%2FPRE%3E%3CP%3EIt%20shows%20name%20of%20the%20site%20and%20status%20So%20I%20change%20correct%20name%20but%20the%20script%20shows%20that%20nothing%20changes...%3C%2FP%3E%3CP%3EAny%20ideas%3F%3C%2FP%3E%3CP%3EThis%20is%20a%20weird%20situation%20cause%20I%20can%20lock%2Funlock%20all%20sites%20from%20online%20tenant%20no%20problem.%20I%20have%20problems%20with%20new%20sites%20from%20local%20AD...%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2090202%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2090625%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20change%20-LockState%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2090625%22%20slang%3D%22en-US%22%3EPlease%20help%20%3A(%3C%2Fimg%3E%3CBR%20%2F%3EI%20am%20stuck%20and%20I%20tried%20everything%20I%20could.%3CBR%20%2F%3EMicrosoft%20support%20didn't%20help%20me%20-%20they%20told%20me%20to%20execute%20this%20query%20and%20go%20back%20with%20results%3A%3CBR%20%2F%3E%3CBR%20%2F%3ESet-SPOSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxxx-my.sharepoint.com%2Fpersonal%2Fxxx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxxx-my.sharepoint.com%2Fpersonal%2Fxxx%3C%2FA%3E%22%20-LockState%20%22Unlock%22%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20I%20already%20did%20that%20and%20showed%20this%20query%20in%20my%20initial%20request%20for%20help.%20I%20am%20lost%20%3A(%3C%2Fimg%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a problem with my Sharepoint Online instance. To prevent sharing files in Microsoft Teams I have locked all personal sites for my previous tenant domain. It works flawlessly, as people cannot use OneDrive anymore.

We then used AD Connect to migrate all users from local AD. We took away right to create personal site with storage for everyone, so when user try to log in OneDrive he gets an error. It works - personal sites are not created.

But before we took away create personal site right - we manually transfered two accounts. Now they are synchronized too. They had mysite tho I so blocked it toghether with the rest.

The problem is that I cannot unlock this mysite anymore...

Set-SPOSite -Identity "https://xxx-my.sharepoint.com/personal/xxx" -LockState "Unlock" Does not work. It does not print any errors...

I use this to check status:

    Foreach($Site in $Sites){      
        Write-Host $Site.Url  
        Write-Host $Site.LockState
    }

It shows name of the site and status So I change correct name but the script shows that nothing changes...

Any ideas?

This is a weird situation cause I can lock/unlock all sites from online tenant no problem. I have problems with new sites from local AD...

1 Reply
Please help :(
I am stuck and I tried everything I could.
Microsoft support didn't help me - they told me to execute this query and go back with results:

Set-SPOSite -Identity "https://xxx-my.sharepoint.com/personal/xxx" -LockState "Unlock"

When I already did that and showed this query in my initial request for help. I am lost :(