BASED IN Antioch, TENNESSEE, CNM TECH IS A BLOG BY CHARLES MCDOWELL. HIS POSTS EXPLORE his studies on computer technology through photos, cool quotes, and study guides.

How to create a power shell job to send out an email

By Charles McDowell

Comptia Certified Linux Networking Professional.

Cisco Certified Networking Technician.

Microsoft Technology Associate Database Administration

You can’t know everything, but you should look at this as you can know anything. Anything that you turn your attention to that you choose to focus on you can understand. Nothing is magic, and you can tear things apart if you need to , to find the details.
— John Carmack

First we create a ps1 script to send the email.

Example:

## Email configuration
$to = "insert email address”
$smtp = "mail.example.com"
$from = " insert email address " 
$subject = "Today was a great Day!"  
$body = "Hello All, <br>" 
$body += "Today was a great day!." 

# Send email.
 send-MailMessage -SmtpServer $smtp -To $to -From $from -Subject $subject -Body $body -BodyAsHtml -Priority high 

Then create a job on task scheduler to run the script at an appointed time.

pic1.png
pic2.png
pic3.png

How to import text files into SQL Server Management Studio in 5 easy steps.

How to Run a SQL script query from power shell