Wednesday, June 24, 2009

MOSS Expiration Issue after installing SP2 for MOSS 2007

Many people are facing problem MOSS expiration After installing SP2 for SharePoint Server 2007, because it incorrectly activates the product expiration date. This means after 180 days the SharePoint Server will become inaccessible to all end users.

As per Microsoft KB Article, follow the steps as mentioned below

  • Click Start, point to All Programs, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.  
  • Click the Operations tab. 
  • Click Convert License Type.  
  • In the Enter the Product Key text box, type your product identification number, and then click OK.  
  • The License Synchronizer Job will run on all computers in the farm after a few moments. After all the computers have updated their license from the timer job, the Convert License Type page will reflect the correct license.
For more informatin, review following article
http://support.microsoft.com/kb/971620

http://blogs.msdn.com/sharepoint/archive/2009/05/21/attention-important-information-on-service-pack-2.aspx

Wednesday, June 3, 2009

How can I modify "Modified", "Modified By", "Created" and "Created By" Field Values Without Changing Version in Published Page List?

SPSite site = null;

SPWeb web = null;
site = new SPSite("http://portal/");
web = site.OpenWeb();
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
SPContentTypeId myContentType = new SPContentTypeId("MyContentTypeId");
PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts(myContentType );
PageLayout pageLayout = layouts[0];
string pageName = Guid.NewGuid().ToString() + ".aspx";
SPUser user = web.EnsureUser("DOMAIN\\ashishk");
string createdDate = "2009-06-03T22:35:10Z";
string modifiedDate = "2009-06-03T22:35:10Z";
web.AllowUnsafeUpdates = true;
PublishingPage newPage = publishingWeb.GetPublishingPages().Add(pageName, pageLayout);
newPage.ListItem["Author"] = user.ID;
newPage.ListItem["Editor"] = user.ID;
newPage.ListItem["Created"] = createdDate;
newPage.ListItem["Modified"] = modifiedDate;
newPage.ListItem.UpdateOverwriteVersion();
web.AllowUnsafeUpdates = false;
web.Dispose();
site.RootWeb.Dispose();
site.Dispose();