MOSS/WSS SiteTemplate codes

If you ever tried to use stsadm -o createsite or createweb operations, you come accorss a the -sitetemplate parameter. It actually took me some time to find the accepted values for this, so I compiled all the ones I could find. I haven’t tried them all, so please keep me posted if you find any…


Web Templates in MOSS 2007

The following are the web templates for MOSS 2007: Template Title Template Name Template Description Global Template GLOBAL#0 This template is used for initializing a new site.   Note: Do not use this template. Team Site STS#0 A site for teams to quickly organize, author, and share information. It provides a document library, and lists…


How to create MySite Programmatically

SharePoint provides APIs to create MySite programmtically. UserProfile object provides a method to create personal site. Following console application creates MySite for a given account: using Microsoft.Office.Server;using Microsoft.Office.Server.Administration;using Microsoft.Office.Server.UserProfiles;using Microsoft.SharePoint;using System.Web; namespace UserProfileCreate{class Program{static void Main(string[] args){ using (SPSite site = new SPSite(“http://servername”)){ServerContext context = ServerContext.GetContext(site);UserProfileManager profileManager = new UserProfileManager(context); string accountName = “domainname\\username”;UserProfile userProfile;if…


The security validation for this page is invalid. Click Back in your Web

The security validation for this page is invalid. Click Back in your Web Got this error when I turned on Annoymous Access in MOSS. Navigate thru the followwing and turn the security validation OffCentral Administration—>application management—->web application settings–>”turn security validation off” This works but is bad practice Instead in order to fix my problem I…


DateTime.ToString() Patterns


Page Title gets changed when the AJAX method is invoked

Bug: In moss the page title gets changed after an Ajax postback Resolution: Simply go to your master page, in the head section, place all the title tag on the same line. Wrong<title>My Title</title> Good<title>My Title</title> That’s it! I got this help from  stephaneperron, more info click here


RunWithElevatedPriviliges is not running with elevated priviliges!!!

Here is code which works for me,   public interface IRemoteMethods : IDisposable    {        void createUserProfile();            }     public class RemoteMethods : MarshalByRefObject, IRemoteMethods    {        public void createUserProfile()        { //Code to create User Profile         }         public void Dispose()      {      }   }     public class RemoteInterfaceFactory : IDisposable    {         private AppDomain…


RunWithElevatedPriviliges and UserProfile

“RunWithElevated() does an ImpersonateSelf(), so the thread is impersonating the process identity. Also, all SPSite objects created within the RunWithElevated() scope are treated as SHAREPOINT\system, have full control over the site. But it does not change HttpContext.Current.User. so if the original user was anonymous, the HttpContext.Current.User is still anonymous. If some code explicitly check against…