Removing Super User and Super Reader account

A colleague of mine had issues with the object cache user accounts (Super User and Super Reader accounts). He used the blog post addressing the access denied errors. The post describes setting the Super User and Super Reader, but it did not describing removing both properties.

My colleague needed to remove the properties, this PowerShell script removes both properties:

# Remove properties $wa = Get-SPWebApplication -Identity "<WebApplication>" $wa.Properties.Remove("portalsuperuseraccount") $wa.Properties.Remove("portalsuperreaderaccount") $wa.Update() Write-Host("Properties count for " + $wa.Url + ": " + $wa.Properties.Count)

I hope it helps those who want to undo their settings. To complete the script:

# Get current properties $wa = Get-SPWebApplication -Identity "<WebApplication>" $user = $wa.Properties["portalsuperuseraccount"] $reader = $wa.Properties["portalsuperreaderaccount"] # Write current properties Write-Host("Properties count for " + $wa.Url + ": " + $wa.Properties.Count) Write-Host("Super user (" + $wa.Url + "): '" + $user + "'") Write-Host("Super reader (" + $wa.Url + "): '" + $reader + "'")

Advertisements

3 thoughts on “Removing Super User and Super Reader account

Add yours

  1. We had a problem with a SharePoint 2010 site after a restore to a acceptance server and domain, the domain is a copy of production. All users including administrators recieve an SharePoint access denied

    Events in ULS:
    AuthZInitializeContextFromSid failed!

    System.IO.FileNotFoundException: Cannot find file
    at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies)

    We aso recieve events about SharePoint\system. We fixed this with Powershell Move-Spuser

    After we ran above script by removing the cache users We could login.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: