Posts

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));   ...

Get all Site Colletions with Primary and Secondary Contatct User Info from Sharepoint Content Database

  --Get all site collections with primary secondary owner user info Select W . FullURl , W . Title , S . OwnerId , Max ( Case When S . OwnerId = U . tp_Id And S . Id = U . tp_siteId then U . tp_Login End ) as PrimaryLogin , Max ( Case When S . OwnerId = U . tp_Id And S . Id = U . tp_siteId then U . tp_Title End ) as PrimaryName , Max ( Case When S . OwnerId = U . tp_Id And S . Id = U . tp_siteId then U . tp_Email End ) as PrimaryEmailAddress , S . SecondaryContactID , Max ( Case When S . SecondaryContactID = U . tp_Id And S . Id = U . tp_siteId then U . tp_Login End ) as SecondaryLogin , Max ( Case When S . SecondaryContactID = U . tp_Id And S . Id = U . tp_siteId then U . tp_Title End ) as SecondaryName , Max ( Case When S . SecondaryContactID = U . tp_Id And S . Id = U . tp_siteId then U . tp_Email End ) as SecondaryEmailAddress , HostHeader , DiskUsed , LastContentChange , W . Id as WebId , W . SiteId , S . RootWe...

Custom Search Result in Sharepoint (FAST Search in 2010)

The following blog explains FAST 2010 for SharePoint 2010 Managed Properties. http://blogs.msdn.com/b/shad_phillips/archive/2010/05/31/fast-2010-for-sharepoint-2010-managed-properties.aspx

How to Delete SPView

Sharepoint Object model doesn't have any SPView.Delete method to delete view. If you want to delete SPView, you have to delete from SPList. void DeleteView( SPList list, SPView view) {      list.Views.Delete(view.ID);      list.Update(); }

Get Yahoo Weather RSS Feed using C#

http://developer.yahoo.com/weather/ http://developer.yahoo.com/dotnet/howto-xml_cs.html