Start-Service -InputObject (get-Service -ComputerName $Computer -Name $srv) $servicePID = (gwmi win32_Service | where ).ProcessID $ServiceArray = 'CitrixADIdentityService','CitrixAnalytics','CitrixAppLibrary','CitrixBrokerService','CitrixConfigSyncService','CitrixConfigurationLogging','CitrixConfigurationService','CitrixConnector','CitrixDelegatedAdmin','Citri圎nvTest','CitrixHighAvailabilityService','CitrixHostService','CitrixMachineCreationService','CitrixMonitor','CitrixOrchestration','CitrixPrivilegedService','CitrixStorefront','CitrixTelemetryService','CitrixTrust','XaXdCloudProxy' #Create a subset of the previous array for services you want to monitor $GetService = get-service -ComputerName $Computer The following is the modified script that includes the Citrix XenDesktop / XenApp 7.17 Delivery Controller services: A few people have reached out to me about using this for Citrix XenApp / XenDesktop environments and the short answer to the question is yes, you can indeed use this script because it universally monitors Windows services. … demonstrating how to use a script to check for hung or stopped services for Exchange and to restart and send an email notification as a reaction to these events.
Monitoring Microsoft Exchange Server 2010, 20 services with PowerShell script and task scheduler I recently wrote the following blog post: