We have worked out how to add a Signature to a single OWA Account using Variables from the individual users account as Powershell commands below
$Signature1 = Get-ADUser username -Properties Name | Select-Object name
$JobTitle1 = Get-ADUser username -Properties Description | Select-Object Description
$separator = "@{name="
$Signature1 = $Signature1 -split $separator
$separator = "}"
$Signature1 = $Signature1 -split $separator
$separator = "@{Description="
$JobTitle1 = $JobTitle1 -split $separator
$separator = "}"
$JobTitle1 = $JobTitle1 -split $separator
$SentbyOWA = "Sent by ORGANISATIONS NAME Web Outlook System"
$Signature1 = $Signature1 + "<br />"
$JobTitle1 = $JobTitle1 + "<br />"
$Signature = $Signature1 + $JobTitle1 + $SentbyOWA
Get-Mailbox -RecipientTypeDetails UserMailbox username | Set-MailboxMessageConfiguration -SignatureHTML $Signature -DefaultFontName "Century Gothic" -DefaultFontSize 3 -AutoAddSignature:$true
However trying to put this into a Powershell that searches thorugh all users in an OU and add this Signature to each of those accounts we are just failing at. Powershell modified below:
$users = Get-ADUser -SearchBase "OU=Staff,OU=Users,OU=BLA - St Catherines,DC=BLA,DC=ORG,DC=UK" -Filter * -Properties DisplayName, sAMAccountName, Description | select-object displayName, sAMAccountName, description
ForEach($u in $users) {
$Signature1 = $u | select-object sAMAccountName
$displayname1 = $u | select-object displayName
$JobTitle1 = $u | select-object description
$SentbyOWA = "Sent by ORGANISATIONS NAME Web Outlook System"
$displayname1 = $displayname1 + "<br />"
$JobTitle1 = $JobTitle1 + "<br />"
$Signature = $displayname1 + $JobTitle1 + $SentbyOWA
Get-Mailbox -RecipientTypeDetails UserMailbox $Signature1 | Set-MailboxMessageConfiguration -SignatureHTML $Signature -DefaultFontName "Century Gothic" -DefaultFontSize 3 -AutoAddSignature:$true
}
Not really sure where we are going wrong, tried loads of different suggestions out on the web but falling over each way
Any suggestions appreaciated
Regards
OWA Email Signature
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: OWA Email Signature
This is a better way using PowerShell.
- $template = '{0}<br />{1}<br />Sent by ORGANISATIONS NAME Web Outlook System'
- $ou = 'OU=Staff,OU=Users,OU=BLA - St Catherines,DC=BLA,DC=ORG,DC=UK'
- Get-ADUser -SearchBase $ou -Filter * -Properties DisplayName, Description |
- ForEach-Object{
- $signature = $template -f $_.displayName, $_.description
- Get-Mailbox -RecipientTypeDetails UserMailbox $_.sAMAccountName |
- Set-MailboxMessageConfiguration -SignatureHTML $signature -DefaultFontName 'Century Gothic' -DefaultFontSize 3 -AutoAddSignature:$true
- }
- devereux0110
- Posts: 38
- Last visit: Mon Oct 02, 2017 7:11 am