Thursday 27 March 2014

Get SharePoint Central Administration site url using PowerShell

There are few ways to get FARM server where SharePoint Central Administration site is hosted.

Using PowerShell cmdLets:-

1- Get-spwebapplication -includecentraladministration | where {$_.DisplayName -match "SharePoint Central Administration*"} | select DisplayName,Url

The above cmdLet is good while you are trying to retrieve url of the CA either it is hosted on same machine or on different one (during n-tier farm architecture)

But suppose, I want to check that does this machine having CA hosted, then above code will not work.
For this we need to run the following:

2- Get-spwebapplication -includecentraladministration | where {$_.IsAdministrationWebApplication} | select DisplayName,Url

Without PowerShell:-

3- Suppose I want to check CA without using PowerShell Snapin then we need to use following:

    3.1 :-Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS\" -Name CentralAdministrationURL - For SharePoint 2013

3.2 :-Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\" -Name CentralAdministrationURL - For SharePoint 2010

No comments :

Post a Comment