MOSS Shared Services Provider Administration Job Error (Event ID 6482)

 

SYMPTOMS

The Event Log shows the following error entry for Office Server Shared Services with Event ID 6482, every couple of minutes:

Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (edc207f7-5d7e-44cc-b65a-2326be88ffca).
Reason: No mapping between account names and security IDs was done. (Exception from HRESULT: 0x80070534)

Additionally, when you click the “View Properties” menu entry of the SSP in Central Administration / Shared Services in this Farm, an error page appers with the following error:

An unhandled exception occurred in the user interface.Exception Information: The specified account name is invalid.
Parameter name: account

CAUSE

The SSP adds the application pool account to the “View Properties” page of the SSP. If this application pool is later changed and the original account is removed from Active Directory, the page crashes because it can’t map the username to the actual user (as there is none to be found). Additionally, there’s a timer job in SSP that refreshes the configuration and it also fails due to the same error.

SOLUTION

  • Set the detailed SharePoint logs in Central Administration, by setting Verbose level for the “Office Server General” category
  • In the logs, check the user that SSP is trying to find
  • Recreate that user temporarily in Active Directory (with no special privileges)
  • Go to the SSP Properties page in Central Administration and remove that user from the last list box in the properties page (“Process Accounts”)
  • Remove that user from the Active Directory

Half-Broken SharePoint Disaster Recovery Story

Today I’ve been greeted by a half-broken SharePoint 2007 development machine. It’s a small farm with one MOSS 2007 server and a SQL Server 2005 on the same virtual machine.

image

What does it mean “half-broken”? Well, the symptoms were missing assembly reference randomly in layouts and content page, unable to show the welcome page, ASP.NET errors with no clear meaning (with COM error codes)…but the Central Administration seemingly was OK.

I decided to uninstall SharePoint and to get a clear install from the start. The uninstaller crashed at more or less the half of the process, so I was left with a half brain-dead SharePoint and unable to install it again.

I googled and I found how to manually remove SharePoint traces. I did it and I was met with a screen like this (without (Beta) in the title, of course):

image

Stefan Gossner has a helpful entry (where I copied this screenshot from) which says that you have to uninstall WSS before reinstalling MOSS. I had no WSS installed but I saw that the SP1 Language Pack files were installed. I removed them with Microsoft Install CleanUp tool.

I installed the MOSS binaries and I started SharePoint Products and Technologies Configuration Wizard. My MOSS is a Spanish SKU and the wizard appeared in English and with an error message that “it could not open the Help file”. After a check, it appeared that the only help locale was the Spanish one, as would be expected with a Spanish SKU.

Luckily, Stefan had another entry in his blog that more or less seemed to match mine. I created the HKEY_LOCAL_MACHINESOFTWAREMicrosoftShared ToolsWeb Server Extensions12.0ServerLanguage3082 entry (for Spanish) and finally I could run the wizard and ultimately recover my development machine.

Stefan, I owe you two beers 😉

image

User Profiles Usage Guidelines from Microsoft

Glancing over the new entries at MSDN for SharePoint, I noticed an article by the name of “Capitalizing On the Social Network Capabilities of SharePoint Server 2007 User Profiles”, written by Antoine Atallah and Martin Gagné from Microsoft.

image

The article is compact and easy to follow. It outlines the architecture of user profiles, with special attention to social relations such as peer, colleagues, direct reports, managers and group membership. It also provides quick code samples for user profile management.

The article was of interest to me because I am very familiar with user profiles of MOSS. I recently developed a set of SharePoint Designer workflow activities that expose user profile properties.

Content Management Interoperability Services, Good News for SharePoint?

A couple of weeks ago, Microsoft, EMC and IBM announced that they agreed on a joint specification of interoperability between their content management platforms. This new protocol is called Content Management Interoperability Services (CMIS) and it is based on SOAP, Atom and REST, all of them public and well-known. It will enable service-oriented architecture in a heterogeneous ECM environment.

What will this mean for SharePoint? Probably Microsoft will launch a CMIS-compliant connector for SharePoint that will expose its content for CMIS-capable applications and consume their content for indexing or query, as announced vaguely on SharePoint ECM blog. It will surely ease the life of a integration-project developer that juggles the information between different ECM systems (SharePoint, Documentum, FileNet…).

CMIS Overview

This new protocol also allows for rich mashups to be created while technology-agnostic (at least, in theory). The protocol also caters for security trimming and authorisation.

I’ll be tuned for the news around this new protocol. In the meanwhile you can download the draft specification yourself and take a look.

How To Expose Files in a Shared Folder for Remote Access with SharePoint

I just completed a Proof-of-Concept setup to allow the users to remotely access files that sit on a network share, using SharePoint and IIS 6.

I have a shared folder in \SHARE2007Shared and I wanted it to be accessible from http://share2007 (the SharePoint portal site).

The outline of the setup is like this:

  • Add a new File Share Content Source to SharePoint (MOSS) search settings, pointed at \SHARE2007Shared

    image
    image

  • Run a full crawl and check that it indexes the files correctly, searching for a file. Notice that the URL of the file is pointing at the file share directly.

    image

  • Open the IIS console and add a new virtual directory within the SharePoint portal site, pointing it at \SHARE2007Shared. Give it any name that suits you. (I chose “uncshares”). I use a fixed identity to access the file share, because SharePoint crawler will perform the security checking for the current user and I avoid identity delegation to the file share.

    image
    image
    image

  • Add a new Server Name Mapping in search settings, replacing file://share2007/shared references to http://share2007/uncshares
    image
  • Run a full crawl, again
  • Search for a file from SharePoint portal. You should notice that the displayed URL is pointing to the IIS virtual directory, not to the file share directly.

    image

Community Kit for SharePoint Needs You!

As you might know, I contribute to Community Kit for SharePoint (CKS). It’s a CodePlex-hosted community project aimed to provide the community with SharePoint extensions and starters that are not present in the out-of-the-box edition.

This project has also put me in contact with some excellent SharePoint professionals who are dedicated to the community, such as Paul Ballard, Zac Smith, Brendon Schwartz, Russ Basiura, Stacy Draper and Dee Anne Kotzur, among others.

Right now, there are several “almost finished” editions, such as:

The CKS:Corporate Intranet Edition

There are several editions that haven’t progressed beyond some initial research. One of them is the Corporate Intranet Edition. The features envisioned for this edition are, mainly:

  • A set of professionally designed master pages and CSS themes
  • A set of templates such as “corporate crisis management”, “risk management” or SOX-compliance template
  • Wildcard search
  • Taxonomy and Tagging content
  • Site creation wizard, to help a user to choose between 40+ templates (most of which will come from Application Templates for SharePoint)

The current state of affairs is that since the beginning we haven’t had the momentum that other CKS editions had, and we couldn’t push the edition to something releasable. The main effort was made by Russ Basiura, Dee Anne Kotzur and myself, but the real-life issues and lack of commitment/feedback from the community took its toll.

However, we’re determined to get the project back to the track and push it forward. But, we can’t do it alone. We need your help!

i want you us army

How Can You Help?

First, check the overall CKS project information and ask yourself if you are really into it. Committing to a community project isn’t something to be judged lightly. You will have to spare some time regularly to make the project progress, or to inform the rest of the team how are you doing, due to sporadic nature of the work in a community of developers.

Do you still want to contribute?

Please keep in mind that your contribution doesn’t necessary have to be code development. This project will eventually need testers and documentation writers as much as developers. If you have trusted colleagues or friends who would be good at either of those roles, please recruit them to be part of the project team.

Ok, so you still want to help us or you know somebody that could help us in CKS:CIE project?

Send an e-mail to either Russ Basiura (russ AT rjbtech.com) or me (ekapic AT gmail.com), explaining your contribution idea and your short background. We will contact you shortly after that.

I don’t want/have time to commit but I have an idea that should be incorporated into CKS:CIE

Please feel free to comment that at the official CKS:CIE page at CodePlex.

The Final Words

Thank you for your interest in reading this post. The SharePoint community is a powerful thing that we all comprise, and we hope that together we can follow our more successful siblings such as CKS:EBE or CKS:EWE.

Hiding List View Group Headers

It’s really annoying that SharePoint displays those pesky column names followed by a colon when you group by a column. In this example I use the the columns “Categoria” and “Titulo” to group a bunch of pages.

image

In addition, the gray header row is ugly, too.

We can hide it with some Content Editor Web Part (CEWP) and JavaScript magic.

The offending elements can be identified:

image

We have to hide the following elements:

  • a TR element with class name ms-viewheadertr (the header row)
  • the fourth and the fifth child of a TD element with class names ms-gb (the column name of the first group by and a colon)
  • the fourth and the fifth child of a TD element with class names ms-gb2 (the column name of the second group by and a colon)

I use the excellent getElementsByClassName function developed by Robert Nyman in order to get those elements by class name.

This is the code to be pasted in a CEWP at the same page where you have the “ugly” list view. Please note that the text node which contains the colon must be removed instead of being hidden.

<script type="text/javascript" language="javascript">
_spBodyOnLoadFunctionNames.push("HideHeaders");

function HideHeaders()
{
  var elements = getElementsByClassName(document, "td", "ms-gb");
  var elem;
  for(var i=0;i<elements.length;i++)
   {
     elem = elements[i];
     elem.childNodes[3].style.display = "none";
     elem.removeChild(elem.childNodes[4]);
   }

  elements = getElementsByClassName(document, "td", "ms-gb2");

  for(var i=0;i<elements.length;i++)
   {
     elem = elements[i];
     elem.childNodes[3].style.display = "none";
     elem.removeChild(elem.childNodes[4]);
   }

  elements = getElementsByClassName(document, "tr", "ms-viewheadertr");

  for(var i=0;i<elements.length;i++)
   {
     elem = elements[i];
     elem.style.display = "none";
   }
}

/*
    Written by Jonathan Snook, http://www.snook.ca/jonathan
    Add-ons by Robert Nyman, http://www.robertnyman.com
*/
function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/-/g, "\-");
    var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}
</script>

This is the result of this code:

image

Much better, isn’t it?

Visual Studio 2008 Now Has VSeWSS Tools, Too!

Excellent news! The SharePoint team has released the Visual Studio Extensions for Windows SharePoint Services (VSeWSS) version 1.2. The only update is that it supports VS2008 and VS2008 only.

The previous version (1.1) worked only with VS2005, so if you have the new incarnation of Visual Studio, download this new version and the user guide, and start coding.

If, however, you still use VS2005, stick with the good old VSeWSS 1.1.

IE and The Mysterious ‘The page took too long to save’ Message

Another one of those “oh my god” moments in SharePoint programming, although it had nothing to do with SharePoint proper.

The Background

I want to dynamically add a DIV alongside a SharePoint field in Publishing page. The intended purpose is to extend the built-in control without any server-side code. I want the DIV to hold a simple hand-crafted AJAX call to add new items.

Everything is okay, I add my code to the SharePoint _spBodyOnLoadFunctionNames.push function, I find the control to be extended and I yank the DIV from its previous location to the parentNode object of the control. It nicely shows the new DIV below the original control:

image

The DIV contains an anchor element that has href=”#” and onclick=”SomeFunction();”. It’s created dynamically when the page loads:

var link = document.createElement("a");
link.href="#";
link.innerHTML = "Agregar nuevo elemento";   
link.onclick = "SomeFunction();";
div.parentNode.appendChild(link);

The Symptoms

When you click the anchor in the added DIV, there’s a 30-second pause during which IE responds to no clicks, after which the following message appears:

Are you sure you want to navigate away from this page?

The page took too long to save. You can click “Cancel”, and then try to save the page again. If you click “OK”, you might lose unsaved data.

Press OK to continue, or Cancel to stay away on the current page.

image

After you click OK, the anchor works well, calling the SomeFunction flawlessly.

The First Suspect

I though that the issue was caused by another function I called, that uses “AJAX” call to owssvr.dll to filter cascading dropdown controls (more on that in next posts). It might leave the HTTP request in a undefined state so that the IE thinks it’s still not loaded.

I commented it out but the error persisted.

The Second Suspect

Then I thought that it has something to do with the appendChild method I use to move the DIV from its placeholder to the new position below the control it’s extending.

I changed the call to dynamically create a new DIV instead of moving the old one to a new position in DOM tree. But, the same error persisted.

The Real Culprit

After David Gutiérrez, one of my colleagues (whose mileage in JavaScript is much greater than mine) revised the code, and after a perfunctory “brain processing” period (which lasted about an hour, in this case), he appeared and outlined the malfunction.

The error message is caused by IE trying to “execute” the new onClick event, which is set to a JavaScript function in this case. But, the syntax is wrong, wrapped inside double-quotes, like in inline HTML.

link.onclick = "SomeFunction();";

The correct syntax is written just like a method call, using only the function name:

link.onclick = SomeFunction;

IE seems to “compile” the string into a method call, but only after you confirm that you want to navigate away. Weird enough.

Unable to Add Summary Links Web Part (Error 0x80070002)

Funny thing happened today when I tried to export / import a site from one site collection into another one. It asked me to close the Summary Links web part, which I did. I tried to add it manually (importing a .webpart file exported from the source site), and it gave me the following error:

Unable to add selected web part(s). Could not load XSL file. The system cannot find the file specified.(Exception from HRESULT: 0x80070002).

SOLUTION:

This error is usually raised when you try to add a publishing-related web part (such as Summary Links) into a non-publishing site. You have to either add it into a site built with a publishing template (Collaboration Portal or Publishing Portal), or to activate the publishing features manually:

  • Activate Office SharePoint Server Publishing Infrastructure feature in site collection features, in Site Collection Administration section of Site Settings page
  • Activate Office SharePoint Server Publishing feature in destination site features, located on Site Administration section of Site Settings page