0
votes

I have a script that creates a .htm and .txt file in the %appdata%\Microsoft\Signatures folder.

I set the signature via registry using:

NEW-ITEMPROPERTY HKCU:'\Software\Microsoft\Office\15.0\Common\MailSettings' -Name 'NewSignature' -Value $SignatureName -PropertyType 'String' -Force

NEW-ITEMPROPERTY HKCU:'\Software\Microsoft\Office\15.0\Common\MailSettings' -Name 'ReplySignature' -Value $SignatureName -PropertyType 'String' -Force

Everything appears to work except the signature does not show in the compose window by default. It will let me add it manually.

If I open up the signature settings area within Outlook, make zero changes (I couldn't if I wanted as it is greyed out) and then close it, the signature starts showing automatically in emails again.

What am I missing? What does opening then closing the signature window do?

2

2 Answers

0
votes

You can use functions within Word to set default signature for new e-mails and replies. Try this:

$Word = New-Object -ComObject Word.Application

$EmailOptions = $Word.EmailOptions
$Signature    = $EmailOptions.EmailSignature

$Signature.NewMessageSignature   = $SignatureName
$Signature.ReplyMessageSignature = $SignatureName

$Word.Quit()
0
votes

Should anyone else come into this issue it was solved by deleting a registry entry.

REMOVE-ITEMPROPERTY -path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Setup\" -name "First-Run"

Adding this in and having it run while Outlook is closed fixed the issue