SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH


Get Central Administration Webapplication  

Sep 022009

With this code you can get the central administration webapplication.

   1:  private static SPWebApplication GetCentralAdministrationWebApplication()
   2:  {
   3:      SPWebService cS = SPWebService.ContentService;
   4:      var service = cS.Farm.Services.GetValue<SPWebService>("WSS_Administration");
   5:      SPWebApplicationCollection webApplications = service.WebApplications;
   6:      foreach (SPWebApplication webApplication in webApplications)
   7:      {
   8:          return webApplication;
   9:      }
  10:      return null;
  11:  }

If you have a better way, let me know :-)

And here we go. A big Thank you goes to Axel Heer.

return SPAdministrationWebApplication.Local;
 
Posted by René Hézser | 1  Comment | Trackback Url  | 0  Links to this post | Bookmark this post with:        
Tags: Development, SharePoint

Links to this post

Comments

commented on  Wednesday, September 02, 2009  8:22 PM  by  Axel Heer
return SPAdministrationWebApplication.Local;

Name *:
URL:
Email:
Kommentar:


CAPTCHA Image Validation