Manage Services on Server shows which SharePoint service is running on a particular server. You can only select 1 server and you won’t get a quick overview of all the services per server. I have created the below script to create a .html file which shows each server and their active or inactive service.

The following script can be copied into notepad and saved as a .ps1 file. Just execute the script to create a .HTML file. When you run the script, it will ask for an export location. This folder does not have to exist on your harddrive. This has been created and tested for SharePoint 2013 and haven’t tested this yet for SharePoint 2010.

#Import SharePoint PowerShell Modules
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Request the location to store the HTML file
$ExportLocation = Read-Host "Enter the location to store the HTML file. (eg. C:\temp). This directory will be created if it doesn't exist"

Function ListServicesOnServer($path)
#Check if directory exists or create the directory
if((Test-Path $path) -eq $false)
mkdir $path
write-host "Folder created" -foregroundcolor yellow
write-host "Folder already exists" -foregroundcolor yellow

#create an unique name
$date = get-date
$today = $date.ToString("ddMMyyyy_HHmm")
$HTMLpath = "$($path)\ServicesOnServer_$($today).html"

#Create HTML File for the information
New-Item -ItemType file $HTMLpath -force | out-null
add-content -value "<html><body><h1>Services on Server</h1><br />" -path $HTMLpath

#Try / Catch statement to get the information
#Get the SharePoint servers in the farm
$servers = Get-SPServer | where {$_.Role -ne "Invalid"}

#Create an HTML Table and headers
add-content -value "<table border='1' style='font-family: Calibri, sans-serif'>
<th style='background-color:blue; color:white'>Service</th>" -path $HTMLpath
$servers | %{Add-Content $HTMLpath "<th style='background-color:blue; color:white'>$($_.Address)</th>"}
add-content -value "</tr><tr>" -path $HTMLpath

#list all services using 1 server
$services = get-spserviceinstance -server $servers[0]

foreach($service in $services)
$serviceTypeName = $service.TypeName | sort-object
Add-Content $HTMLpath "<td>$($service.TypeName)</td>"
$servicesOnServers = get-spserviceinstance | where-object {$_.TypeName -eq $serviceTypeName} | %{Add-Content $HTMLpath "<td>$($_.status)</td>"}
Add-Content $HTMLpath "<tr></tr>"

add-content -value "</table></body></html>" -path $HTMLpath
write-host "Script Done" -foregroundcolor green
write-host "$($_.Exception.Message)" -foregroundcolor red



You should already have created a .ps1 file and saved this to a predefined location:


Run PowerShell as administrator and run the following command:

& “C:\Temp\ListServicesOnServer.ps1”


Press enter and fill in a location:


Press enter:


The output should look like below:



  • Hi this is really good. I am trying to modify it so that it list the service applications per server / minrole . I can run
    Set-SPServiceApplication but that just list all of them

    • Hello Manoj,

      The script will retrieve the services at the moment that the script ran.
      If you schedule this for every 10 minutes you will have the status each 10 minutes, you won’t be able to know when the service has been changed exactly but somewhere in those 10 minutes.

      Kind regards,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.