Friday, August 3, 2018

Get IIS App Pool status of specific server in a SharePoint farm

Use below one line statement to get the App pool status on specific server in a farm. $name variable contains the fully qualified domain name of the server. Below example get the details of IIS application pool named "SharePoint Web Services Root".

$name = "<insert Server FQDN>";
$aps=Invoke-Command -ComputerName $name {Import-Module WebAdministration; Get-ChildItem IIS:\AppPools | where{$_.Name -eq "SharePoint Web Services Root"}}


Find SharePoint Server Name hosting Central Admin site using powershell.

Took me sometime to figure this out. I am using two commands in a single line statement to fetch the server name which is hosting central administration website in a SharePoint farm.

Note-: Output of this will show you two servers in case you have configured central admin on two servers in a farm.


Get-SPServer |where {(Get-SPServiceInstance -Server $_.Address |Where {$_.Status -eq "online" -And $_.TypeName -eq "Central Administration"}) }