7 Şubat 2013 Perşembe

Sharepoint 2010 Access Denied Error for all users

Hi,
This problem cost me 2,5 days to figure it out.

I needed to change the service password of the server, after I did that (along with changing managed account pass, iis app pool passes and all services credentials) I could not login to one of my Web App !

I ve got "Access Denied" error even for admins..

Solution was to delete the Web App and creating a new one and associating the old content db with this new web app.

Steps:

- Delete Web App via Central Admin (Click Delete - On upcoming window choose delete IIS but NOT delete Content DB)
- Created new web App with same name but with different content_db name. (we are just going to replace it anyway)
- Make the new web App content db offline:  CA - Application Management - Manage Content Databases-Select the db, Make the Database Status- Offline
- Run the following stsadm command to bind the old content db:
stsadm -o addcontentdb -url http://yourwebapp:port -databasename yourcontentdb -databaseserver yoursqlserver
Thats all



Other solutions I ve tried:

- Check if db is read only: (CA - Application Management - Manage Content Databases-Select the db Check the status) or Run this SQL:
SELECT name, is_read_only
FROM sys.databases
- Check if Site Collection is read only  (locked) CA - Application Management - Configure quatas and locks
- Check if the IIS folders permissions are OK: Go to IIS folder of the WEb App, check the security tab and check if your user is in the admin users. (WPG ADMIN, Administrators, etc.)
- Check the IIS Application Pool user-passwords are OK
- Check the all the Services running have the right credentials (Run services.msc checked all the services using this account)
- Check if the user in Web App User Policy (Object Cache): CA - Application Management - Select web app - Select User Policy on Top - Check the reader and superuser accounts (there are plenty of links in google..)
- Check if another page in the Web App is working: Just check http://yoursite/_layouts/settings.aspx. If it is working fine for all users, then you ve got something wrong in your homepage. Probably a webpart or a custom control does not have sufficent permission.



Setting Object Cache Accounts in SharePoint 2010

Hi,

Just copy the code below, change the first 3 parameters, you are good to go !

Note:
If you use claims auth. you need to add "i:0#.w|" in front of your username like I did.

$wa = Get-SPWebApplication -Identity http://yoururl
$SuperUserAcc = "i:0#.w|WW300\w99s0700"
$SuperReaderAcc = "i:0#.w|WW930\w99s0700"
Function Set-WebAppUserPolicy($wa, $userName, $displayName, $perm)
{
    [Microsoft.SharePoint.Administration.SPPolicyCollection]$policies = $wa.Policies
    [Microsoft.SharePoint.Administration.SPPolicy]$policy = $policies.Add($userName, $displayName)
    [Microsoft.SharePoint.Administration.SPPolicyRole]$policyRole = $wa.PolicyRoles | where {$_.Name -eq $perm}
    If ($policyRole -ne $null) {
        $policy.PolicyRoleBindings.Add($policyRole)
    }
    $wa.Update()
}

$wa.Properties["portalsuperuseraccount"] = $SuperUserAcc
Set-WebAppUserPolicy $wa $SuperUserAcc "Super User (Object Cache)" "Full Control"
$wa.Properties["portalsuperreaderaccount"] = $SuperReaderAcc
Set-WebAppUserPolicy $wa $SuperReaderAcc "Super Reader (Object Cache)" "Full Read"
$wa.Update()