Posts

Showing posts from April, 2011

SPWeb Property Bag

The following url explains about SPWeb Property bag and how to add properties to the SPWeb Properties.  http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/ Hierarchical Object Store (SPPersistedObject) Provides the methods for an object to automatically serialize its state, persist that state in a permanent store, retrieve it at a later time, and deserialize it back into an in-memory object. http://www.chaholl.com/archive/2011/01/30/the-skinny-on-sppersistedobject-and-the-hierarchical-object-store-in.aspx http://www.chaholl.com/archive/2010/12/13/persisting-a-stream-to-the-sharepoint-configuration-database.aspx

Create DefaultSharepoint Groups

I am recently trying to create site collection using Admin Web Service. When site creating using admin web service, share point not creating default share point groups. You have to write custom code to create share point default groups. The following is the code to create default sp groups. public bool CreateDefaultSPGroups( string url)     {         bool isGroupsCreated = false ;         try         {             using ( SPSite site = new SPSite (url))             {                 using ( SPWeb web = site.OpenWeb())                 {        ...

RunPowershellCommand From ASPx Page

private void RunPowershellCommand( string loginName)     {         try         {             PSSnapInException exc = new PSSnapInException ();             RunspaceConfiguration rc = RunspaceConfiguration .Create();             PSSnapInInfo info = rc.AddPSSnapIn( "Microsoft.Sharepoint.Powershell" , out exc);             Runspace rs = RunspaceFactory .CreateRunspace(rc);             rs.Open();             Pipeline cmd = rs.CreatePipeline( string .Format( "set-SPSite -Identity http://sitecollection -SecondaryOwnerAlias {0}" ,loginName));   ...