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!

Advertisement

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…


Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.