Combine one part SharePoint 2007 (RTM), one part Internet Explorer 7 and one part Anonymous Access and you'll have a recipe that exposes the annoying prompt to install Microsoft's Name.dll ActiveX control on every page load of your SharePoint web site.
From what I've read, Name.dll provides "presence" functionality that has to do with user identity and collaboration features that I won't pretend to understand since I haven't worked with those features yet. What do I do know is that we don't require any of these features for our public facing anonymously accessed blog site.
I'm sure someone out there has figured this out but I toured SharePoint's extensive admin web site and searched the internet and the best advice I could find is to uninstall the ActiveX Control (using regsvr32 /u) and supposedly our problem would go away. This is great but it doesn't seem like the best way since we have several top level SharePoint sites running on the same server and we have no idea how removing a piece of the system will affect the other sites.
So what's the magic fix?
SharePoint is complex and can be brittle if we start poking around at the file system level so let's do this by the numbers.
First we have to understand that for each top level Web Application or Extension that's created through the SharePoint admin site there is a corresponding IIS web site created. Amongst other things, each one of these IIS web sites contains a virtual directory called "_layouts" and the path (by default) for all of them is:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS"
Obviously the intention here is for SharePoint to have access to common code and content which also provides one central file location for possible future updates to the SharePoint product. Pretty smart.
I'm hoping that you didn't just skip ahead and are still reading because we probably shouldn't change the original file as this will affect all SharePoint sites and might disable functionality that you didn't intend on so let's do this instead.
- Create a new folder someplace on your server and copy the contents of the previously mentioned "LAYOUTS" folder to the new folder (be sure you have the right location because there are a few 1033 and similarly named folders along the way).
- Let's ensure SharePoint will have permission to access the files. Through Explorer, open the properties for your newly created folder and under the security tab add the "WSS_WPG" account (the default Read & Execute, List, and Read permissions are enough) and let's add the WSS_ADMIN_WPG account with full permissions (see image below).
- In the IIS Manager Console, open the properties for the "_layouts" virtual directory (under the web site you want to modify) and change the local path directory to your newly created folder.
Now let's go check your Web Site and make sure everything is working (be sure to test from outside your network as an anonymous user if you can).
If everything is ok then let's jump to the heart of this post. Our unwanted ActiveX feature lives in a script file called INIT.JS located in the \LAYOUTS\1033 folder. If you open this file in notepad and look for a function called EnsureIMNControl() it's pretty easy to understand that the intent of this function is to instantiate the ActiveX object and assign it to the global variable IMNControlObj providing certain conditions are valid such as browser and O.S. requirements.
Simply commenting out the ActiveXObject line should do the trick for you, like this:
//IMNControlObj=new ActiveXObject("Name.NameCtrl.1");
Lastly before applying any updates or service packs to SharePoint you'll probably want to reverse this customization and perform these steps again after the update to ensure your web site is running on the latest code.
P.S. Don't forget that most browsers cache script files, so you might have to force a browser refresh to see the change. And definately let me know if you found any other tips about this topic.
function EnsureIMNControl()
{
if (!bIMNControlInited)
{
if (browseris.ie5up && browseris.win32)
{
//@cc_on
//@if (@_jscript_version >=5)
//@ try
//@ {
//@ //IMNControlObj=new ActiveXObject("Name.NameCtrl.1");
//@ } catch(e)
//@ {
//@
//@ };
//@else
//@end
}
bIMNControlInited=true;
if (IMNControlObj)
{
IMNControlObj.OnStatusChange=IMNOnStatusChange;
}
}
return IMNControlObj;
}