Category Archives: SharePoint

SQL Client Configuration

There is a great deal of MSDN articles dedicated to describing network communication protocols and how to configure client network configuration for SQL server (Client Network ConfigurationChoosing a Network Protocol). However, MSDN seems to fail to mention how to start the network utility on the client, and the fact that there are two different flavors of it (32- and 64-bit).

Here are the executable and paths which you need to launch on the client (e.g. SharePoint servers):

32-bit version:
%SystemDrive%\Windows\System32\cliconfg.exe

64-bit version:
%SystemDrive%\Windows\sysWOW64\cliconfg.exe

Note: SharePoint 2010/2013 servers surprisingly uses 32-bit version configuration and not 64-bit. Nonetheless, it is a good idea to enable client libraries and create aliases for both 32- and 64-bit version.

sqlclient

More helpful articles on the topic:

SharePoint 2013 Navigation and Mobile Devices

SharePoint 2010 and 2013 navigation unfortunately has never been designed as mobile- or touch-friendly. Top menu’s “mouse hover” effect provides serious interaction challenges when your submenus also happened to be URLs as well (catalog-based publishing sites for example). There has been a number of solutions posted to solve this issue for SP2010 sites, in particular a popular post OOTB Navigation fix to support IPad & I-Devices. However, with the user interface changes in SP2013 those solutions stopped working.

Below is a JavaScript snippet that solves the navigation troubles in SP2013, by allowing users click once to expand the submenu, and clicking it again to navigate to the underlying URL.
Insert this code at the end of the masterpage, or add it in $(document).ready() event handler:

if (navigator.userAgent.indexOf('Mobi') >= 0) {
    $('ul.root li.dynamic-children a.dynamic-children').bind('touchstart', function(e) {
        var isHoveredSubmenu = $(this).parent().hasClass('hover');
        if (!isHoveredSubmenu) {
            $(this).click(function(c) { c.preventDefault(); });
        } else {
            var location = $(this).attr('href');
            window.location = location;
        }
    });
}

A few notes about the code:
– The code only runs on mobile devices, the check for which is simplified and based on this recommendation: MDN: Mobile, Tablet or Desktop. Essentially the code searches for ‘Mobi’ string in the user agent string. This way it includes all Chrome, Safari and Opera browsers for all iOS and Android devices.
– Selector is much shorter and applies to all ‘a’ elements that have children based on ‘dynamic-children’ class presence.
– The rationale behind detecting if submenu is displayed or not, is based on the fact that when the submenu is displayed its class name is appended with ‘hover’. So we simply need to see if that class name is present in the element.

Backup, Restore, Migration in SharePoint 2013

SharePoint 2010 to SharePoint 2013 Migration
Migration process of SharePoint 2010 sites to 2013 is relatively straightforward, but requires some preliminary work done in SharePoint 2010 environment:

  • Prepare SharePoint 2010 sites for back up – put backed up sites in read-only mode or disconnect the sites from users for the duration of backup.
  • Backup the content database on SharePoint 2010 SQL server, using SQL tools
    Please note: You cannot use backup commands of stsadm or Powershell to take backups of SP2010 sites and can only use SQL Server capabilities.
    Because of this limitation if you like to upgrade only selected few site collections you might have isolate them into a separate content database.
    Here is a script you might find helpful for this isolation in SP2010:
    Get-SPSite -ContentDatabase SourceContentDbName | Move-SPSite -DestinationDatabase DestinationContentDbName
  • Prepare SharePoint 2013 environment – deploy any features or webparts used by backed up SP2010 sites if there are any. For example:
    Add-SPSolution "d:\path\customsolution.wsp"
    Install-SPSolution -Identity "customsolution.wsp" -WebApplication http://webappurl/ -GACDeployment
  • Restore SQL database backup on SharePoint 2013 SQL server, using SQL tools
  • Test the content database for any errors, by executing:
    Test-SPContentDatabase –Name contentdb –WebApplication http://webappurl/
  • Mount the content database, if previous test results are acceptable. Mounting the database will upgrade its content:
    Mount-SPContentDatabase –Name contentdb –WebApplication http://webappurl/

References:
MS: Upgrade content databases to SharePoint 2013

Backup and Restore Site Collections in SharePoint 2013
The Powershell commands are very straightforward:

Backup-SPSite -Identity http://web/path/site -Path D:\path\site.bak –Verbose
Restore-SPSite -Identity http://web/path/site -Path D:\path\site.bak -Force –Verbose
Restore-SPSite -Identity http://web/path/site -DatabaseServer DBSERVER -DatabaseName SP_Content_Database -Path D:\Path\site.bak -Force -Verbose

Notes:
If you are restoring to a specific content database, you must explicitly specify server name as well.
If you would like to control amount of site collections which can be stored in a particular content database, you can do so by using this little script.
In this script, we set maximum number of sites to 3 for the content database that contains site collection “http://web/path/site”:
Get-SPContentDatabase -Site http://web/path/site | Set-SPContentDatabase -MaxSiteCount 3 -WarningSiteCount 0

References:
MS: Backup Site Collections
MS: Restore Site Collections

Known Issues – Backup and Restore Process Sensitivity to Environment Version

When you are backing and restoring site collections between different server environments one of the key things that you need to pay particular attention to is SharePoint patch level. The environments you are backing and restoring to must be at the same level.

Here is an example of error when you try to restore a site collection backed up in SharePoint at newer patch level.
After running the following restore command in Powershell, we see a very convoluted error message that has nothing to do with the actual error:
Restore-SPSite -Identity http://web/path/site -DatabaseServer DBSERVER -DatabaseName SP_Content_Database -Path D:\Path\site.bak -Force -Verbose
Restore Powershell
Exception: DirectoryNotFoundException – in reality has nothing to do with the actual error, which we can see in ULS log tells us that there is a version mismatch, and that is why our restore is failing.
Restore ULS Log
References:
Blog: Backup and Restore Site Collection in SP2013

How to Create Minimal Web Pages in SharePoint

This brief article talks about how to create minimalistic pages in SharePoint without deploying any server-side code, and with minimum effort by using only SharePoint Designer. By minimal web pages, here I mean master page and web pages that have only bare bones with essential web part zones, without any additional HTML markup for header, footer, left-navigation, or additional server-side controls (such as, site actions, search box, etc.).

Please note, even though this post is about SharePoint 2007 implementation, very similar technique is applicable to SharePoint 2010 as well, with changes to the content of the master page mostly.

1. Create a minimal masterpage with SharePoint Designer following this MSDN article: How to: Create a Minimal Master Page.

Basically, it all comes down to creating a file in SPD, which we are going to call msminimal.master, under your site’s http://site / _catalog / masterpage (Master Page Gallery). That msminimal.master must contain only essential empty zones, and no client-side markup or server-side controls.

My only changes to the master page from MSDN article would be adding Visible=”false” attribute to Site Actions and Welcome if you would like to hide them in your future web pages:

      <wssuc:Welcome id="explitLogout" runat="server" Visible="false" />
      <PublishingSiteAction:SiteActionMenu runat="server" Visible="false" /> 

 

2. While in SharePoint Designer, create a new web aspx page and reference your new master page changing MasterPageFile attribute from ~masterurl/default.master to _catalogs/masterpage/msminimal.master.

Here is an example of the simplest web page with just one web part zone:

<%@ Page language="C#" MasterPageFile="_catalogs/masterpage/msminimal.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
  <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="MainZone">
    <ZoneTemplate>
    </ZoneTemplate>
  </WebPartPages:WebPartZone>
</asp:Content>

3. Now if you want to edit your new custom web page visually in a browser and add web parts, you would need to use one old non-documented trick. Since there is no familiar header or site actions menu, you need to type in your Internet Explorer the following URL, in order to switch between view and edit mode, and back :

javascript:MSOLayout_ToggleLayoutMode();
(Refer to my previous article on highly useful non-documented shortcuts http://www.artykul8.com/2011/03/useful-sharepoint-shortcuts/)


4. After adding all necessary content to your custom web page, it contains only content and no additional header, footer, etc. This sometimes comes extremely useful if you want to display some specific content in a Page Viewer Web Part on another SharePoint site, or in a frame in another non-SharePoint web application.

SharePoint 2010 White Papers

I put together a collection of white papers and diagrams from Microsoft site, which are related to SharePoint 2010 deployment and configuration. Some of them are extremely useful when it comes to planning a new SharePoint installation or preparing technical documentation. I organized SharePoint Server 2010 resources into three categories, trying to match MOF phases – plan, deliver, operate. All other resources are grouped under specific server they relate to, namely Foundation, Search, FAST, Project Server, etc.

Planning phase

Getting started with Microsoft SharePoint Server 2010 (SharePtServGetStarted.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=91B175B1-01D0-48DD-9147-58B6E96C500B

Capacity planning for Microsoft SharePoint Server 2010 (SharePtServPlanCap.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5F403AD5-0352-4C9B-841B-D73D4CB88F45

Planning guide for server farms and environments for Microsoft SharePoint Server 2010 (SharePtServPlanPlatfm.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=BBD414C5-00FE-4A65-8A35-D52C9AA84609

Topologies for SharePoint Server 2010 (Topologies_SharePointServer2010.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=FD686CBB-8401-4F25-B65E-3CE7AA7DBEAB

Extranet Topologies for SharePoint 2010 Products (OIT2010_Model_ExtranetTopologies.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=EB4BFF25-BABA-4112-B518-F2FC442D5467

Planning guide for sites and solutions for Microsoft SharePoint Server 2010, Part 1 (SharePtServPlanSandS1.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=10104E47-7DFE-4AE5-A9EA-459E6AEBD34E

Planning guide for sites and solutions for Microsoft SharePoint Server 2010, Part 2 (SharePtServPlanSandS2.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=11A9EACD-78C9-442E-AA5A-EE66D9CD5F77

SharePoint 2010 Virtualization Guidance and Recommendations (oit2010-whitepaper-virtualization-guidance.docx)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7b50c3ec-abb6-4416-a454-c461bff22e78

SharePoint Server 2010 design samples: Corporate portal with classic authentication or with claims-based authentication
(SPS_2010_Design Sample_Corporate Portal_ClaimsAuth.vsd; SPS_2010_Design Sample_Corporate Portal_ClassicAuth.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=704C984D-2245-4A7D-8FF5-1E57C9A473A8

Delivery phase

Deployment guide for Microsoft SharePoint Server 2010 (SharePtServDeployment.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=A54C7191-EB05-489E-A7CA-6453ABA8877C

SharePoint 2010 Products Deployment (Deployment_SharePoint2010Products.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7604212E-67A6-407D-AE5C-9BB9D6325E17

SharePoint 2010 Products: Virtualization Process (SharePoint2010_ServerVirtualization.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=87F00C5D-1F62-4D3F-AC92-B91EB70D317E

Hosting Environments for SharePoint 2010 Products (Hosting_SharePointProducts2010.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=326845D1-95DB-4E55-B65A-218509DEBE24

Services in SharePoint 2010 Products (SvsSingleFarm_SharePointProducts2010.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=B9CA7745-FFA4-43CA-A638-E1AD868187CE

Cross-farm Services in SharePoint 2010 Products (SvsCrossFarm_SharePointProducts2010.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5141C91C-0922-44FC-AAF4-64C5156209EF

Configuring Kerberos Authentication for Microsoft SharePoint 2010 Products (SP2010 Kerberos Guide.docx)
http://www.microsoft.com/en-us/download/details.aspx?id=23176

Remote BLOB storage for Microsoft SharePoint Server 2010 (SharePtServBLOB.doc)
http://www.microsoft.com/en-us/download/details.aspx?id=2002

Operational phase

Operations guide for servers and server farms for Microsoft SharePoint Server 2010 (SharePtServOperations.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=944519E8-E130-4E7A-8A8D-978B10AF77C1

Technical reference for Microsoft SharePoint Server 2010 (SharePtServTechRef.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=A3B9FA1B-0300-489E-8D67-F14DEB4C3A56

Microsoft SharePoint Server 2010 Technical Library in Compiled Help format (SharePtServer2010.chm)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3629425D-1505-456E-89E2-EDE95F75FFE5

Business continuity management for Microsoft SharePoint Server 2010 (SharePtServContinuity.doc)
http://www.microsoft.com/en-us/download/details.aspx?id=9623

SP 2010 Foundation Resources

Getting started with Microsoft SharePoint Foundation 2010 (SharePtFoundGetStart.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2D789716-2293-4007-A485-E092CA5EDC60

Deployment guide for Microsoft SharePoint Foundation 2010 (SharePointFoundDeplo.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4CF799A5-5C53-4BE7-B8DD-43DC8C49A1D4

Planning guide for Microsoft SharePoint Foundation 2010 (SharePointFoundPlan.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=206A9F99-C42D-42B2-9094-A3B2EF4FCD12

Operations guide for SharePoint Foundation 2010 (SharePointFoundOps.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=71434993-E26F-43BE-B1BC-1DCAE65D46B5

Microsoft SharePoint Foundation 2010 Technical Library in Compiled Help format (SharePtFound2010.chm)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C8CF1631-0F48-4A02-A18D-54B04EB7F0A7

Technical reference for Microsoft SharePoint Foundation 2010 (SharePointFoundTecR.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=32AE8CBE-A657-481D-A1D6-46140495231A

Business continuity management for Microsoft SharePoint Foundation 2010 (SharePtFoundContinuit.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=288C1D67-E980-477D-9EDD-F0865C3E533B

Search

Getting Started with Enterprise Search in SharePoint 2010 Products (Getting Started with Enterprise Search in SharePoint 2010 Products.docx)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=96663B95-E9F5-48C8-BEB9-A15AD119C499

Search Technologies for SharePoint 2010 Products (Search Model 1 of 4 – Search Technologies.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D7C0091E-5766-496D-A5FE-94BEA52C4B15

Search Environment Planning for Microsoft SharePoint Server 2010 (Search Model 2 of 4 – Search Environment Planning.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5655EACA-22DF-4089-BCD3-38A1F5318140

Search Architectures for Microsoft SharePoint Server 2010 (Search Model 3 of 4 – Search Architectures.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=22FFC029-2C08-457D-8311-CA457C6D160E

Design Search Architectures for Microsoft SharePoint Server 2010 (Search Model 4 of 4 – Farm-level design.vsd)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5A3CA177-FB9A-4901-9797-0C384277DB7C

Microsoft Search Server 2010 Technical Library in Compiled Help format (SearchServer2010.chm)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=73B58B97-847A-4D86-892E-464826603D2B

FAST Search

Microsoft FAST Search Server 2010 for SharePoint Enterprise Search Evaluation Guide (FASTSearchServer2010_SearchEvalGuide.docx)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=F1E3FB39-6959-4185-8B28-5315300B6E6B

FAST Search Server 2010 for SharePoint Capacity Planning (FASTSearchSharePoint2010CapacityPlanningDoc.docx)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=65B799E3-825C-4398-8CD7-3311D3297997

Deployment guide for FAST Search Server 2010 for SharePoint (FASTDeployment.doc)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=36411DA5-EA48-4AB5-8114-21ADB21259DE

Microsoft FAST Search Server 2010 for SharePoint Technical Library in Compiled Help format (FASTSearch2010.chm)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=EAD44C66-7D02-4EDF-9E56-2F56C6F59F22

Virtualization

Virtualization Overview, Methods, and Models
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=884E2E2A-E4D5-43C5-AAAF-5C1E6D793D9C

IT Manager: Platform Solution Blueprint – Virtualization
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=1D7B4A0C-F21A-4E07-A779-F9F61A6D45D1

The Most Useful Undocumented SharePoint 2007/2010 Shortcuts

Here are a few of the most useful SharePoint shortcuts, which work in all versions of SharePoint 2007 and 2010 (even 2003).

Enter page web part maintenance mode

Append ?contents=1 to the URL of the page for which you want to enter maintenance mode, for example:
http://site/page.aspx?contents=1

Enter page edit mode

Including system pages, such as view or edit pages: NewForm.aspx, EditForm.aspx, AllItems.aspx, etc.
In Internet Explorer’s URL bar type:

javascript:MSOLayout_ToggleLayoutMode();
or
javascript:MSOTlPn_ShowToolPane(‘2’);

For more details on ShowToolPane parameter, you can refer to this old MSDN article.

Heads up: There is one thing you must seriously consider before editing a system page. This lesson I learnt the hard way from exposing modified edit pages to end-users. When you modify a previously read-only system page, such as a view or edit form, through the shortcut explain above, you make it available for editing to anyone who has contribute rights on that library or list. Hence that page becomes vulnerable to accidental changes by non-power users, because previously hidden Edit Page menu will be visible to them in Site Actions menu.

Access administration pages

A few quick shortcuts that I find not only can save time, but also help bypass obscurity created by system administrators:

http://site/_layouts/savetmpl.aspx – Save site as a template
http://site/_layouts/create.aspx – Create (libraries, lists, pages, sites)
http://site/_layouts/settings.aspx – Site settings
http://site/_layouts/newsbweb.aspx – Create a new site or workspace
http://site/_layouts/sitemanager.aspx – Site content and structure browser

Fix for a Recurring Meeting Workspace Error

A great time saving post on MS SharePoint Designer Team blog:
How to fix: Recurring Meeting Workspace error: ‘g_InstanceID’ is undefined

I ran into this problem after applying a custom master page to a meeting workspace, which was linked to a recurring event. Date selection on the left navigation stopped working if a custom master page was selected, but it worked fine when site master page was set to a standard SharePoint one.

Adding these two lines to a custom master page, mentioned in the blog post above, resolve the issue:


<%@Master language="C#"%>
<%@ Register Tagprefix="Meetings" Namespace="Microsoft.SharePoint.Meetings" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
...
<body>
<Meetings:PropertyBag runat="server"/>
...

VSeWSS BIN Deployment and CAS Policy Issues

There is a bug in Visual Studio Extensions for WSS (including VSeWSS 1.3) – if you are targeting your web part deployment into BIN instead of GAC, you are in for an upleasant surprise, when you realize that you custom access policy is not working.

The reason for this is incorrect assembly reference in manifest.xml, which results in invalid URL for IMembershipCondition element, where binary name has an extra .dll suffix in CAS policy file, just like in the file excerpt below:

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\CONFIG\wss_custom_wss_mediumtrust_guid.config

   ...
  <CodeGroup version="1" PermissionSetName="mycustomwebpart.wsp-12345678-90AB-1234-5678-90ABC3456-1">
    <IMembershipCondition version="1" Name="MyCustomWebPart" Url="$AppDirUrl$/bin/MyCustomWebPart.dll.dll" />
  </CodeGroup>

The solution for this problem is relatively simple:

– in your Visual Studio open WSP View pane, click Refresh button to update solution files

– open manifest.xml and in <Assembly> element remove extension ‘.dll’ from Assembly Name attribute:

<Solution ...>
  ...
  <CodeAccessSecurity>
    <PolicyItem xmlns="http://schemas.microsoft.com/sharepoint/">
      ...
      <Assemblies>
        <Assembly Name="MyCustomWebPart" />
      </Assemblies>
    </PolicyItem>
</Solution>

Additionally, while editing manifest.xml if you like to grant your web part additional security privileges you might need to add a few lines to PermissionSet element. In particular, if you are using MOSS Search or Search Server functionality, such as KeywordQuery or FullTextSqlQuery classes you would need RegistryPermission and FileIOPermission lines.

<PermissionSet class="NamedPermissionSet" version="1" Description="Example">
...
<IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"version="1" Unrestricted="true" PathDiscovery="*AllFiles*" />
</PermissionSet>

Additional resources:

SharePoint Server 2007 on Windows Server 2008 R2

This already became a somewhat old topic, since Microsoft released a proper SharePoint Server 2007 slipstream edition with SP2.

Nonetheless, it is important to remember that if you are planning to install SharePoint Server 2007 or Windows SharePoint Services 3.0, it has to be at least SP2, anything before that is not supported on Windows Server 2008 R2. SharePoint Team Blog: Install SharePoint Server 2007 on Windows Server 2008 R2

There was a bit of confusion/frustration raised over this topic, because WSS 3.0 slipstream with SP2 came out long ago (April 2009), but MOSS 2007 was for some reasons left behind, and MSDN subscribers saw slipstream SP2 edition only in January 2010.

WSS 3.0 with SP2:
x86: http://www.microsoft.com/downloads/details.aspx?FamilyId=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en
x64: http://www.microsoft.com/downloads/details.aspx?familyid=9FB41E51-CB03-4B47-B89A-396786492CBA&displaylang=en

MOSS 2007 with SP2 (trial):
x86: http://www.microsoft.com/downloads/details.aspx?FamilyID=2e6e5a9c-ebf6-4f7f-8467-f4de6bd6b831&displaylang=en
x64: http://www.microsoft.com/downloads/details.aspx?FamilyID=3015fde4-85f6-4cbc-812d-55701fbfb563&displaylang=en

Windows Server, IIS/SharePoint, and NULL SID ‘Audit Failure’ Security Errors

I stumbled across this issue, while troubleshooting errors accessing host-named SharePoint sites locally from within a web server (sites with specified host headers different from local server name).
While I had no problems accessing the same site from another computer, I could not login and access any pages locally. I was constantly prompted for user name and password receiving access errors, while my Security event log was getting filled with ‘Audit Failure’ log messages about NULL SID: “An account failed to log on. Security ID: NULL SID”.

After eliminating all possible causes – NLB, SharePoint site configuration, IIS security and settings – it turned out that it wasn’t even IIS- or SharePoint-related issue at all. Starting with Windows Server 2003 SP1 and higher (Windows Server 2008 and R2 editions in that list as well), as a security measure Microsoft introduced a loopback check to prevent man-in-the-middle (MITM) attack, when a malicious application (such as spyware) can try to eavesdrop communication with a remote server by introducing itself locally as a remote host. Please note: loopback check happens only when host headers do not match local computer name.

The symptoms and solutions are described in Microsoft KB article: http://support.microsoft.com/kb/896861
Additionally a few other related issues (accessing network shares, etc) are outlined in two more KB articles: http://support.microsoft.com/kb/887993 and http://support.microsoft.com/kb/926642.

To deal with this issue you have two options: either explicitly specify all host headers in the registry (the most secure, but also the most cumbersome solution), or disable loopback check entirely.

If you decide to opt for completely disabling loopback check (on a development or test server), here is one command line you can achieve it through. Please remember to restart your server after changing the registry!

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v DisableLoopbackCheck /t REG_DWORD /d 1