PoshCode Archive  Artifact [9174642f2f]

Artifact 9174642f2f0b6b3b69970f6739e9e981defa20763c3e9ee48d5bb73cd3b6d026:

  • File EmailService.ps1 — part of check-in [8ab9f5ab7e] at 2018-06-10 13:44:12 on branch trunk — Simple one liner that emails the status of a service(s) to a recipient. (user: Johnny Reel size: 706)

# encoding: ascii
# api: powershell
# title: EmailService
# description: Simple one liner that emails the status of a service(s) to a recipient.
# version: 1.04
# author: Johnny Reel
# license: CC0
# x-poshcode-id: 4652
# x-archived: 2013-12-06T18:09:13
# x-published: 2013-11-27T16:33:00
#
#
# Email-ServiceStatus

# Version 1.04
# Johnny Reel
# 11/26/13

# Suggested use is to run as scheduled task on a server. Will email the status of service(s) to recipient(s).

Send-MailMessage -To "user@company.com" -From "sender@company.com" -SmtpServer <servername> -Subject "<service or server name> Service Status" -body ((gsv -cn <servrename> -Name <servicename>) | Out-string)

exit 4