Skip to content

Instantly share code, notes, and snippets.

@tonejito
Created April 30, 2018 22:12
Show Gist options
  • Save tonejito/4a907e14c0f44029dfdebebe229de207 to your computer and use it in GitHub Desktop.
Save tonejito/4a907e14c0f44029dfdebebe229de207 to your computer and use it in GitHub Desktop.
Display status of VMware vCenter Server services and dependencies
#!%SystemRoot%\System32\WindowsPowerShell\v1.0\PowerShell.exe
#
# Check-VMware-vCenter-Services
# Display status of VMware vCenter Server services and dependencies
# Andres Hernandez - April 2018
#
# https://docs.microsoft.com/en-us/powershell/scripting/powershell-scripting?view=powershell-3.0
# http://adamringenberg.com/powershell2/
# https://allunifiedcom.files.wordpress.com/2010/07/powershell_v2_owners_manual.pdf
# Hack to maximize the current console window
PowerShell -WindowStyle Maximized "Clear-Host"
# Get service status for SQL Server, VMware* and vCenter services
Write-Host "Service status:"
Get-Service |
Where-Object { $_.DisplayName -like "*SQL*" -or $_.DisplayName -like "*VMware*" -or $_.DisplayName -like "*vCenter*" } |
Sort-Object -Property @{Expression="Status";Descending=$true}, @{Expression="DisplayName";Descending=$false} |
Format-Table -AutoSize -GroupBy "Status"
# Print the detail of the required services
Write-Host "Service detail:"
$a = @()
foreach ( $service in @( "MSSQLSERVER" , "vpxd" , "vctomcat" , "vimQueryService" , "vimPBSM" ) )
{
$a += Get-Service $service | Select-Object Status,ServiceName,DisplayName,RequiredServices,DependentServices
}
Sort-Object -InputObject $a -Property "Status" | Format-List
# Press any key to exit
Read-Host
@tonejito
Copy link
Author

tonejito commented Apr 30, 2018

Example output:

Service status:


   Status: Running

Status  Name                   DisplayName
------  ----                   -----------
Running MSSQLFDLauncher        SQL Full-text Filter Daemon Launcher (MSSQLSERVER)
Running MSSQLSERVER            SQL Server (MSSQLSERVER)
Running SQLSERVERAGENT         SQL Server Agent (MSSQLSERVER)
Running MSSQLServerOLAPService SQL Server Analysis Services (MSSQLSERVER)
Running SQLBrowser             SQL Server Browser
Running MsDtsServer100         SQL Server Integration Services 10.0
Running SQLWriter              SQL Server VSS Writer
Running VMTools                VMware Tools Service
Running VMUSBArbService        VMware USB Arbitration Service
Running vctomcat               VMware VirtualCenter Management Webservices
Running vpxd                   VMware VirtualCenter Server
Running ADAM_VMwareVCMSDS      VMwareVCMSDS


   Status: Stopped

Status  Name                   DisplayName
------  ----                   -----------
Stopped MSSQLServerADHelper100 SQL Active Directory Helper Service
Stopped vimQueryService        vCenter Inventory Service
Stopped vmvss                  VMware Snapshot Provider
Stopped vCOConfiguration       VMware vCenter Orchestrator Configuration
Stopped vimPBSM                VMware vSphere Profile-Driven Storage Service


Service detail:


Status            : Running
ServiceName       : MSSQLSERVER
DisplayName       : SQL Server (MSSQLSERVER)
RequiredServices  : {}
DependentServices : {SQLSERVERAGENT}

Status            : Running
ServiceName       : vpxd
DisplayName       : VMware VirtualCenter Server
RequiredServices  : {ProtectedStorage, lanmanworkstation}
DependentServices : {vimPBSM, vimQueryService, vctomcat}

Status            : Running
ServiceName       : vctomcat
DisplayName       : VMware VirtualCenter Management Webservices
RequiredServices  : {vpxd}
DependentServices : {}

Status            : Stopped
ServiceName       : vimQueryService
DisplayName       : vCenter Inventory Service
RequiredServices  : {vpxd}
DependentServices : {vimPBSM}

Status            : Stopped
ServiceName       : vimPBSM
DisplayName       : VMware vSphere Profile-Driven Storage Service
RequiredServices  : {vimQueryService}
DependentServices : {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment