-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Don't know when but Outlook has been updated to only look for signature files suffixed with the mailbox address in use. Those without suffix are considered device-wide and cannot be used.
signature (my.emaill@address.net).htm
The downloaded and unzipped signature files must be renamed accordingly for Outlook to recognise them.
if ($signatureFile.Name -like "*.htm" -or $signatureFile.Name -like "*.rtf" -or $signatureFile.Name -like "*.txt") {
# Get file content with placeholder values
$signatureFileContent = Get-Content -Path $signatureFile.FullName
# Replace placeholder values
$signatureFileContent = $signatureFileContent -replace "%DisplayName%", $userObject.DisplayName
$signatureFileContent = $signatureFileContent -replace "%GivenName%", $userObject.GivenName
$signatureFileContent = $signatureFileContent -replace "%Surname%", $userObject.Surname
$signatureFileContent = $signatureFileContent -replace "%Mail%", $userObject.Mail
$signatureFileContent = $signatureFileContent -replace "%Mobile%", $userObject.Mobile
$signatureFileContent = $signatureFileContent -replace "%TelephoneNumber%", $userObject.TelephoneNumber
$signatureFileContent = $signatureFileContent -replace "%JobTitle%", $userObject.JobTitle
$signatureFileContent = $signatureFileContent -replace "%Department%", $userObject.Department
$signatureFileContent = $signatureFileContent -replace "%City%", $userObject.City
$signatureFileContent = $signatureFileContent -replace "%Country%", $userObject.Country
$signatureFileContent = $signatureFileContent -replace "%StreetAddress%", $userObject.StreetAddress
$signatureFileContent = $signatureFileContent -replace "%PostalCode%", $userObject.PostalCode
$signatureFileContent = $signatureFileContent -replace "%Country%", $userObject.Country
$signatureFileContent = $signatureFileContent -replace "%State%", $userObject.State
$signatureFileContent = $signatureFileContent -replace "%PhysicalDeliveryOfficeName%", $userObject.PhysicalDeliveryOfficeName
# Convert file name to explicitly target mailbox with email address suffix.
$signatureFileTargetName = $signatureFile.BaseName + " (" + $userPrincipalName + ")" + $signatureFile.Extension
# Set file content with actual values in $env:APPDATA\Microsoft\Signatures
Set-Content -Path "$($env:APPDATA)\Microsoft\Signatures\$($signatureFileTargetName)" -Value $signatureFileContent -Force
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels