Automating the Outlook signature involves many things from gathering information from AD to environmental variable and so on.
We have seen people using inspirational quotes at the bottom of their signature and periodically they change the quotes.
How about using a new quote every day in your signature and that being automated using PowerShell?
This blog is about the automation of quotes into an email signature.
I am getting quotes from http://www.eduro.com/ (Thanks to Eduro).
Full Script Link
Core Script
- $AppData=$env:appdata
- $SigPath = ‘\Microsoft\Signatures’
- $LocalSignaturePath = $AppData+$SigPath
The 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 the user data.
Here comes the web scrapping.
- $url = “http:
- $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 - The text of the signaturecustom.txt file needs to be modified as per your signature.
Once the signature custom template is selected from the signature ribbon button in Outlook, it will display the output like this.
Lastly, you can schedule it in Task Scheduler.