Quick Tip: Local Central Admin SPWebApplication

I’ve seen several incoming searches like “SPWebApplication for Central Admin”, so hopefully this will provide a quick answer:

SPAdministrationWebApplication.Local

Which really just returns:

SPAdministrationWebApplication.GetInstanceLocalToFarm(SPFarm.Local);

And a quick example in PowerShell for good measure:

PS C:\> [system.reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
PS C:\> $ca = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local
PS C:\> $ca.DefaultServerComment
SharePoint Central Administration v3
PS C:\> $ca.AdministrativeTasks.Items | select Title -first 3

Title
-----
Add anti-virus protection
READ FIRST - Click this link for deployment instructions
Configure Workflow Settings

Hope this helps!

Advertisements

One Response to “Quick Tip: Local Central Admin SPWebApplication”

  1. Keith Dahlby Says:

    So I just noticed that I included this same tip as a footnote on the other post. Depressing that Google knows my blog better than I do…


Comments are closed.

%d bloggers like this: