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!
August 12, 2008 at 6:17 pm
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…