Powershell – SharePoint user permissions headache after site collection restore

iispowershellsharepointsharepoint-2013

Have got a SharePoint 2013 installation running as a development system (cloned from our live environment).

If I create a new site collection and set the primary and secondary site collection administrators to sp_farm and sp_admin respectively, I am able to access (view) the website using either of these two accounts – great.

However, after restoring a site collection (using PowerShell Restore-SPSite) from our live SharePoint farm into our development server, it seems that something strange is happening with the permissions on the restored collection. Everything looks OK configuration wise, e.g. both sp_farm and sp_admin are in the site Owners group with full control. I can even access the website via the browser fine using sp_farm. The problem is that for some reason I cannot access the site using sp_admin. I am greeted with the usual message "Sorry, this site hasn't been shared with you" – despite being set as an admin for the site collection.

I figured that I would set up access requests for the site collection – so I submitted an access request as user sp_admin. I then go to the access requests management area using sp_farm, see the request from sp_admin, and I give sp_admin full control rights. However, upon re-accessing the site with sp_admin I am told to submit an access request again. At this point surely I should have access?

I have tried numerous suggestions including:

  • Clearing browser cache
  • Restart Microsoft SharePoint Foundation Web Application
  • Restarting the server
  • Checked that claims authentication is being used (as per the live environment)
  • Tried clearing and re-adding sp_admin into various groups with full control
  • Tried giving site collection administration rights to a different Windows User Account (this worked – I could access the site as soon as I'd added the user)

Really stumped here as to why the sp_admin account is not working, as the environment should be fully reflective of our live environment.

Like I said, creating a new site collection with exactly the same permissions gives me no problems. The problem only occurs after I've restored a site collection from our live environment.

I have read that clearing the Distribution Cache may be an option?

Does anybody else have any suggestions?
Thanks

Best Answer

The only instance where I have run into this is when the publishing feature is enabled and the master pages and page layouts are not published. Go to the Content and structure page on the Site collection root (Site Settings > Content and structure) The go to Master Page Gallery and publish your custom files. Also, if Publishing is enabled, check to make sure the pages in the Pages library are published.

Related Topic