SharePoint Server Error: Some or all identity references could not be translated
17. September 2008 10:44

You are likely to run into this error after renaming a server with:

stsadm -o renameserver

Or changing the name of your domain, or the domain your server is a member of.

It's generally because you didn't follow the appropriate order-of-operations for the change, but just the same, it can be rather tedious to isolate the correct fix.

Fixing it:

The first thing you should confirm is that you've fixed your Alternate Access Mappings.  If you can't get to central administration, you can do this via the STSADM tool.

Enumerate Mappings:

http://technet.microsoft.com/en-us/library/cc288303.aspx

Add Mapping:

http://technet.microsoft.com/en-us/library/cc287762.aspx

Delete Mapping:

http://technet.microsoft.com/en-us/library/cc287725.aspx

Next, ensure that your farm account is accurate, especially if a domain changed:

Do this using the STSADM update farm credentials command:

stsadm.exe -o updatefarmcredentials -userlogin domain\username -password password

Then do an IISRESET.

Tags: , , Comments (0) | Permalink
Programmatically Hide Pages From Navigation When Added To List
8. September 2008 10:17

This has become a fairly frequent request from customers using SharePoint 2007 for Web Content Management. 

Specifically, in a MOSS publishing site, it is requested that links are not automatically added to navigation when the pages are created in the pages library.  Instead, the page should be marked as 'hidden' in the navigation automatically when added to the pages library.  This applies to either Quick Launch, or the Top Navigation (or both).

Typically this is because the governance of the site involves a different person managing the navigation than who may be managing the pages, thus even when a page is added it should not show in the nav until unhidden by another party.

The easiest way I'm aware of to achieve this is with a simple event handler on the pages libraries to hide the page once it is added.

The PublishingPage object will wrap an SPListItem for us, and give us access to the navigation settings.

Here is a simple implementation of this event receiver.  Note that it references Microsoft.SharePoint.dll and Microsoft.SharePoint.Publishing.dll

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Publishing;
namespace PageNavigationEvent
{
public class HandlePageAdd : SPItemEventReceiver    
{
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
try
{
this.DisableEventFiring();
if (PublishingPage.IsPublishingPage(properties.ListItem))
{
PublishingPage newPage;
newPage = PublishingPage.GetPublishingPage(properties.ListItem);
newPage.IncludeInCurrentNavigation = false;
newPage.IncludeInGlobalNavigation = false;
}
}
catch
{
// do something clever
}
finally
{
this.EnableEventFiring();
}
}
}
}


 



For initial deployment and testing, I recommend you try out the fantastic Event Receiver Manager which is simple to install and will allow you to graphically add your receiver to a specific pages library without building a feature.



For proper deployment you will want to create a feature, which can install the receiver on all pages lists.  You can find instructions on doing this here.

Tags: , , Comments (1) | Permalink