Please upgrade your web browser now. Internet Explorer 6 is no longer supported.
Thinking Web Solutions?
We create smart, fun, functional websites that make your web a better place.

User cannot be found error

When clicking on the Site Collection Administrators link in Central Admin the following error screen displays:

USerNotFoundError

This annoying error can occur during wss migrations, basically it means the primary or secondary site collection administrator refers to a user that does not exist.

Unfortunately it is not possible to get into the screen where you would make the change. The STSADM command siteowner returns the same error.

The only solution that I have found is to make a small edit to the database. To do this open up the content database that corresponds to the site collection and look at the Sites table. Find the row for the site that is throwing the error and update the ownerID or SecondaryContactID (See disclaimer below).

Now if you have a number of sites then you will need to work out which site is causing the problem - and the guids arent terribly descriptive.

So how do we work out which one? PowerShell to the rescue!!

If you haven't discovered the awesomness of PowerShell you should go away and do that right now. Otherwise you can keep reading :)

The first command I will run loads the SharePoint dll (I actually have this setup in my profile).

[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

Then I will create and SPSite object that will contain a reference to the site collection that is causing the error.

$spsite = New-Object Microsoft.SharePoint.SPSite("http://wsssite")

Now I can run commands on this object to discover various pieces of info. I could have created a little visual studio console app but that would just be annoying, plus interactively inspecting .Net objects is pretty damn cool.

So to get the site ID:

$spsite.ID.ToString()

And to get the details of the primary/secondary site coll admin details:

$spsite.RootWeb.SiteAdministrators

if you want a list of all available users you can try:

$spsite.RootWeb.AllUsers | ft Name, ID -auto

Now once you have worked out which user is causing problems (it could be both). Just update the IDs with valid user IDs and try navigating to the site collection administrators screen.

Disclaimer:

Editing the database in SharePoint is completely unsupported by Microsoft. If you do decide to make changes, I'd highly recommend making a backup first.

2 comments for “User cannot be found error”

  1. Alexander Bautz  6/28/2007

    Thanks! - saved my day.

  2. Peter Holpar  5/13/2011

    As you wrote, the root of the issue is the incorrect OwnerID or SecondaryContactID value in the content DB.
    As far as I know the primary/secondary site coll admin cannot be get via
    $spsite.RootWeb.SiteAdministrators
    but $spsite.Owner and $spsite.SecondaryContact, however these properties will throw the "User cannot be found" exception if the value is incorrect. See details in my posts about detecting the source of the issue and how to resolve it:
    http://pholpar.wordpress.com/2011/05/13/user-cannot-be-found-error-solved-using-a-sql-query/
    http://pholpar.wordpress.com/2011/05/13/user-cannot-be-found-error-solved-using-the-sharepoint-object-model/

    Peter

Post a comment