Set Quotes in email Signature

Quote for the day in Email Signature

Automating the outlook signature involves many things by gathering information from AD, environmental variable and so on.

We have seen people using inspirational quotes in bottom of their signature and periodically they change the quotes. How about every day new quote in their signature that too automated.

This blog is about the automation of quotes in to signature.

I am getting quotes from http://www.eduro.com/ Thanks to Eduro

Script

$AppData=$env:appdata

$SigPath = ‘\Microsoft\Signatures’

$LocalSignaturePath = $AppData+$SigPath

Signature information will be available in C:\Users\<username> \AppData\Roaming\Microsoft\Signatures

if (!(Test-path “$LocalSignaturePath\signaturecustom.txt”)){

@”

First and Last Name

Title | Group

CompanyName| Direct phone | Mobile phone | firstname.lastname@company.com

“@ | out-file “$LocalSignaturePath\signaturecustom.txt”

}

It will create a text file in the C:\Users\<username> \AppData\Roaming\Microsoft\Signatures\signaturecustom.txt for the first time

This file needs to be changed as per user data.

Here comes the web scrapping

$url = “http://www.eduro.com/&#8221;

$r1= Invoke-WebRequest -Uri $url

$r4=@{}

$r2=($r1.ParsedHtml.getElementsByTagName(‘p’) )[0]

$r4[1]=$r2.innerText

$r3=($r1.ParsedHtml.getElementsByTagName(‘p’) )[1]

$r4[0]=$r3.innerText

Note: signaturecustom.txt text needs to be modified as per your signature.

Once signature custom template is selected from signature Ribbon Button from outlook.it will display the output like this.

At last you can schedule it in task scheduler.