Archives

Currently Reading

Interesting TimesSoul MusicMen at ArmsLords and LadiesWitches AbroadReaper Man

More of Sytone's books »
Book recommendations, book reviews, quotes, book clubs, book trivia, book lists

Getting the Central Admin URL for a Farm in SharePoint

Toy CarI recently needed to get the Url of the CA for a SharePoint farm, after a bit of hunting in the API it was tracked down under the SPAdministrationWebApplication object.

C#

SPAdministrationWebApplication caWebApp = Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local;
var url = caWebApp.Sites[0].Url;

PowerShell

$caWebApp = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local
$caWebApp.Sites[0].Url
  • Guest

    Nice one.. in PowerShell I can get the Url directly from Local: [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local.Url

  • http://profiles.google.com/blaireau47 Eric Blais

    Thanks, easy way to dynammically call SharePoint admin Config Web Services