Check Windows Service State
This is a scheduled task for checking the state of a service on one or more Windows Server PAM devices.
The task supports connecting to both domain-joined & local Windows Servers.
It requires:
- A PAM Server provisioned as a Vault in PPA
- One or more Windows Servers provisioned in the PAM Server
- WinRM connectivity to each Windows Server
Playbook Files
Running this Playbook
- Click download playbook
- Import the downloaded file via the Playbooks page on PPA
- Build the playbook from the Edit & Build tab
- Run the playbook from the Preview & Deploy tab
Integrations
- PPA User Interface & Events
- PAM Server Devices & Active Directories
- Windows Server Services
- PPA Tools Lists & Generate
Required PAM Inventory
- One or more Active Directories
- One or more Windows Server devices attached to an Active Directory
Credentials
This task will use each device's control account in PAM to make the connection.
Each Windows device control account must have permissions to view & start services.
What the Task Does
- Gets one or more Windows devices from a PAM Server
- Checks the state of a specific service on each Windows device
- Starts the service if it is not running (optional)
- Sends an email alert if the service was not running on any devices
Schedule Payload
This task should be started by a PPA schedule.
The following information is required in the task payload:
pam_address
: the IP address or hostname of the PAM Vault in PPAdevice_hostnames
: a list of Windows device hostnames in PAMservice_name
: the name of the service to checkalert_email_address
: an email address to send alerts to (if applicable)restart
: either true or false, denoting whether to start the service if it is not running
Using the following payload, the task will:
- Get the 3 supplied devices from PAM Vault pam.internal.net
- Check the Windows Update Service on the 3 devices
- Start the service if it is stopped
- Send any stopped service alerts to sysadmin@example.com
{
"pam_address": "pam.internal.net",
"service_name": "wuauserv",
"device_hostnames": [
"windows-server-1",
"windows-server-2",
"windows-server-3"
],
"restart": true,
"alert_email_address": "sysadmin@example.com"
}
You can use the example payload above as a template.
Powershell Remoting (WinRM)
This task uses Powershell Remoting over WinRM to connect to the Windows Server.
See this Microsoft article for more information on how to securely enable WinRM.
Connection Settings
By default this playbook will:
- Use SSL when connecting to the Windows server
- Validate the Windows server certificate
You can change these values by uncommenting lines 165 & 166.
Get PPA for free!
Start automating your estate with a free 30 day trial today. No signup required!
Get PPA ExpressDocumentation
Installation Guide
See how easy it is to get started with our installation guide
Playbooks
View our task writing reference guide
Plugins
See how to integrate with different systems using our plugins reference guide.