I 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.
[code lang=”csharp”] SPAdministrationWebApplication caWebApp = Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local; var url = caWebApp.Sites.Url; [/code]
[code lang=”ps”] $caWebApp = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local $caWebApp.Sites.Url [/code]
If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you!