Skip to content

andrewsFL/PSServiceChecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSServiceChecker - Powershell Service Checker & Email Alert

Description

Project consists of a simple Powershell script, CSV for storing services/statuses desired and an XML file for storing email credentials which must be generated. It will check the status of each service that is listed and log the current status. If the status is different from the desired one, the script will attempt to set the service to the correct status and will send an email alert with the results.

Languages and Utilities Used

  • PowerShell

Environments Used

  • Windows 11 (24H2)

Script walk-through:

In the project directory, run '$credential = Get-Credential', enter your email username and password:
PSServiceChecker Steps

Now in the project directory, run '$credential | Export-Clixml -Path ".\emailcred.xml"':
Disk Sanitization Steps

Open 'servicechecker.ps1', change the circled fields to the appropriate values for your email configuration:
Disk Sanitization Steps

Now open 'services.csv' and change the 'Name' and 'Status' values to the services you want to check and the desired status:
Disk Sanitization Steps

Now open Powershell as administrator and run the script:
Disk Sanitization Steps

You can see the output in log.txt:
Disk Sanitization Steps

You will receive an email like this showing the service which was stopped and if it successfully started:
Disk Sanitization Steps

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published