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