A public update for the Service Pack 2 expiration date issue is now available

Over on the SharePoint Team blog they have published details of an update that resolves the product expiration issue with SP2. A quick quote from their blog:

The update can be applied before or after Service Pack 2 installation.  If the update is applied prior to installing Service Pack 2 it will prevent the expiration date from being improperly activated during installation of Service Pack 2, if it is applied after Service Pack 2 it will remove the expiration date incorrectly set during installation of Service Pack 2.

Also they plan on releasing an updated SP2 package that doesn't exhibit this problem, time to update my slipstreamed install sources...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Remember that the XSLT select is case sensitive...

I was customising a people search result web part this week and couldn't figure out why the mobile phone field was not rendering in the results. I could see it was in the AD properties, was making it through user profile import and then helped it through to managed metadata in the search results, I even checked the raw XML for the search results which showed it there as well. So I was down to checking my XSLT, I had camel cased the name of the field in my select code, as is my habit with coding to make it easily readable, but the XSLT was looking to match the case returned by the search results which was all in lower case.

A quick crrection and refresh and they all appeared as they should. Another little puzzle solved...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Using [Today] or [Me] in SharePoint calculated columns

If you try this in the browser you will get a message alon the line of Calculated columns cannot contain volatile functions like Today and Me'. At this point you go D'Oh!

But.... you can !!!

Before creating your calculated column you will need to create a column called Today or Me (depending on the calculation you want to create). Once this has been created, SharePoint lets you use the [Today] or [Me] functions in the calculation.

This example shows how to create an age calculated column.

1. In your SharePoint list, create a column, title = DOB, type = Date, format = date only.

2. Create a column, title = Today, type = text.

3. Create a column, title = Age, type = calculated, calculation = DATEDIF([DOB],[Today],"Y")

4. Delete the column titled 'Today'

Now add a new item to the list. Set the DOB date (to somewhere in the past!) and save. The Age should have now been correctly calculated in Years.

Note that once you have deleted the Today or Me column, if you try to edit the calculation in the future, SharePoint will complain again. However, you can simply create another column (Today or Me), edit your calculation, then Delete teh today / Me column again.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint User From ID

Finding a user object from a user id.

using (SPSite site = new SPSite("http://localhost/")){ 
    using (SPWeb web = site.AllWebs[0])  {     
    
SPUserCollection userCollect =  web.AllUsers;
     SPUser user = userCollect.GetByID(3);
 
   }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Search AD by Email

This code snippet allows you to search Active Directory for a given email address and
returns you the coresponding user object.  

String email = testUser@dev.lan; 

DirectoryEntry LdapConnection = new DirectoryEntry(); 
DirectorySearcher search = new DirectorySearcher(LdapConnection); 
search.SearchScope = SearchScope.Subtree; search.Filter = "(proxyaddresses=smtp:" + email + ")"; 
SearchResult result = search.FindOne();  

if
(result != null)
  { 
DirectoryEntry deDirEnt = result.GetDirectoryEntry();
  
Console.WriteLine("Address Found");
 
DirectoryEntry d = deDirEnt.SchemaEntry;
 
}
  else  { 
Console.WriteLine("Address not found!");
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments on the blog

I've been made aware that comments on the blog are not available.

We will get the development team to investigate this and apply SP2 (making sure that all blogs will not explode after 180 days! Wink ) - Please bear with us

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint service Pack 2 bug

SharePoint SP2 will expire 180 after implementation of the service pack.

Taken from the SharePoint team blog ....

"During the installation of SP2, a product expiration date is improperly activated. This means SharePoint will expire as though it was a trial installation 180 days after SP2 is deployed. The activation of the expiration date will not affect the normal function of SharePoint up until the expiration date passes. Furthermore, product expiration 180 days after SP2 installation will not affect customer’s data, configuration or application code but will render SharePoint inaccessible for end-users"

A KB article has been released on this and a fix is being worked on quickly!

We all make mistakes ... Embarassed

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add the BIN folder to the path environment variable with powershell

I often go to execute a stsadm command and find it is not in the path on the server I am working on, so I looked for a while of a way of adding it permanently through powershell and then realised it's a straightforward task with .NET code. The following will add the BIN folder within the program files structure to the PATH environment variable at local machine level so that all users will benefit.

   1:  $envpath = [environment]::GetEnvironmentVariable("Path","Machine")
   2:  $binpath = $env:Programfiles + "\Common Files\Microsoft Shared\web server extensions\12\BIN"
   3:  if ($envpath.contains($binpath) -ne $true ) {
   4:  $envpath = $envpath + ";" + $binpath
   5:  [environment]::SetEnvironmentVariable("Path",$envpath,"Machine")
   6:  Write-output "BIN Path added."
   7:  }
   8:  else
   9:  {
  10:  Write-output "BIN Path already added."
  11:  }

I have added a check to not add it if it is already present as the traditional method of using

SET PATH=%PATH%;C:\Program files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN

ends up with multiple copies of the BIN path in the variable and only applies for the current session.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

owssvr.dll - Beware of multiple selection lookups

owssvr.dll can be used in InfoPath projects to provide filtered or cascading drop down lists. Use an XML datasource - the syntax is http://yourserver/yourweb/_vti_bin/owssvr.dll?Cmd=Display&List={guid}&XMLDATA=TRUE.

However, beware if your list contains a lookupfield that allows multiple selections. If you have this, then the above syntax will return an invalid XML, or a blank data set.

List contains lookup field(s) with single selection - syntax works.
List contains lookup field(s) with multiple selection - syntax fails.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint SP2

Announced, and sure to be a popular download.

Firstly, there is a ton of information released on this service pack and the SharePoint team have done well to list it.

the packs...

WSS Specific Download Locations
•  Windows SharePoint Services 3.0 Service Pack 2 (x86)
http://www.microsoft.com/downloads/details.aspx?FamilyId=79BADA82-C13F-44C1-BDC1-D0447337051B 
•  Windows SharePoint Services 3.0 Service Pack 2 (x64)
http://www.microsoft.com/downloads/details.aspx?FamilyId=79BADA82-C13F-44C1-BDC1-D0447337051B Windows SharePoint Services 3.0 Language Pack Service Pack 2 (x86)
•  http://www.microsoft.com/downloads/details.aspx?FamilyId=085E5AC8-58F6-4CF9-8012-33B95EE36C0F
•  Windows SharePoint Services 3.0 Language Pack Service Pack 2 (x64)
http://www.microsoft.com/downloads/details.aspx?FamilyId=2C2B6CAF-B46D-45EB-AC4D-DEAAA48C3A2C
MOSS Specific download locations are here:
2007 Microsoft Office servers Service Pack 2 (x86)
•  http://www.microsoft.com/downloads/details.aspx?FamilyId=B7816D90-5FC6-4347-89B0-A80DEB27A082
•  2007 Microsoft Office servers Service Pack 2 (x64)
http://www.microsoft.com/downloads/details.aspx?FamilyId=B7816D90-5FC6-4347-89B0-A80DEB27A082
•  2007 Microsoft Office servers Language Pack Service Pack 2 (x86)
http://www.microsoft.com/downloads/details.aspx?FamilyId=01C6A3E8-E110-4956-903A-AD16284BF223 
•  2007 Microsoft Office servers Language Pack Service Pack 2 (x64)
http://www.microsoft.com/downloads/details.aspx?FamilyId=66C5026F-9F47-4642-8378-2526918009FA

Part of the pack is a tool to check for upgrade issues ready for SharePoint 2010.

For a slightly more in depth post, read Joel's Post on the Service Packs

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day