Skip to main content

Posts

Showing posts from December 2, 2012

SharePoint site upgrade utility using C#

Hi people,     Recently in my spare time i have developed an windows form application which does SharePoint site up gradation without using either stsadm command or powershell script..  My windows form application looks as follows The functional over view: On click on Load button (1) present at the top , it should load all the Solutions present in the solution repository in the SharePoint central administration and add all the solution names to the dropdown present below the load button(1). private void loadSolBtn_Click( object sender, EventArgs e)               {                      foreach ( SPSolution sol in SPFarm .Local.Solutions)                      {                            if (!cmbDeploy.Items.Contains(sol.Name))                            {                                   cmbRetract.Items.Add(sol.Name);                            }                      }               } Note:In the above code, the

How to get the SharePoint central admin url programmaticaly via C#?

I had come across a situation where i had to get the sharepoint central admin's url.. You can follow the following snippet of the code. At the begining add the namespace  using Microsoft.SharePoint.Administration; SPAdministrationWebApplication centralAdminFarmUrl =  Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local ; String  centralAdminUrl = centralAdminFarmUrl.Sites[0].Url;  This may help someone -Cheers Pradeepa Achar