Saturday, March 11, 2017

How to Lock Site Collection in SharePoint Online and have redirect users to another site


Requirement:

When users browse to the site collection https://domain.sharepoint.com/sites/sitecollection1 it should be locked and they should be re-directed to another page and should be notified about the same.

I created a page called it "Lock-Site.aspx" under root site collection https://domain.sharepoint.com/ and gave view permission to everyone group specifically on the page where I have added text message "The site that you are trying to access has been locked by the IT Department. If you have any questions please contact Administrator admin@domain.onmicrosoft.com"

I ran below command to achieve this.

1. Set-SPOSite -Identity https://domain.sharepoint.com/sites/sitecollection1 -LockState "NoAccess"
2. Set-SPOTenant -NoAccessRedirectUrl "https://domain.sharepoint.com/SitePages/Lock-Site.aspx"

Behavior:

When the users try browsing the site https://domain.sharepoint.com/sites/sitecollection1 they would redirect to https://domain.sharepoint.com/SitePages/Lock-Site.aspx which states "The site that you are trying to access has been locked by the IT Department. If you have any questions please contact Administrator admin@domain.onmicrosoft.com"


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Search Box