Retire those legacy farms and sites. SharePoint on-premise locking, unlocking and no access sites

I had to retire an old SharePoint 2013 on-premise farm following a successful migration project. Since this wasn't a wholesale migration, there was a small level of uncertainty whether we moved all the relevant content over. I removed locked all the sites in the farm as read-only and parsed the IIS logs to monitor access. When I was satisfied that I had redirected all the users to the new locations, I removed access to all sites and will leave it like that for a couple months before retiring the servers.


This works much better than shutting down the servers. If you've ever had to turn on a server that has been offline for an extended period you have no doubt experienced domain membership issues, patching compliance issues, outdated anti-virus signatures, etc.


If someone needs access to content in their My Site or something, I can unlock it by using the PowerShell command:


set-spsite -identity https://mysite/username -LockState "Unlock"

Unlock all sites in a farm:

Get-SPWebApplication | get-spsite -limit all | set-spsite -LockState "Unlock"


Lock all sites in a farm:

Get-SPWebApplication | get-spsite -limit all | set-spsite -LockState "ReadOnly"


Disable access to all sites in the farm:

Get-SPWebApplication | get-spsite -limit all | set-spsite -LockState "NoAccess"



Comments

Popular posts from this blog

Robocopy Error 31 A device attached to the system is not functioning

"The following factors also affect the level of access for" user with excess permissions

Unknown server tag 'AdminControls:MigrationToolPromotionTip'. in Central Admin after installing SharePoint 2013 security update KB4482464