Monday, December 4, 2017

SharePoint PowerShell Get-SPWeb Access Denied





I joined a company where they have a strict policy for not using service accounts for any administrative tasks. I was given an admin account for which DBA's provided access in the database. I thought I was set to use PowerShell when some commands(Get-SPsite, Merge-splog etc) worked. However I received the error below when I try to see the sub sites structure in a site collection.



To resolve, follow the steps below.


1. Go to Central Administration -> Manage Web Applications
2. Select the web application on which you are trying to run the powershell. This highlights the options like User policy, permissions policy etc
3. Select the User policy, provide your account details and select the "Full Control".


This gives your account the full control to all the content in that web application.