Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

How to create Email signature based on specific template for each people in certain OU ?

Hi All,

Can anyone here please share some tips or steps in Group Policy in how to create the Outlook Email signature for each people in different OU ?

For Example:

Domain.com/Users/Accounting --> Email Signature Template ACC1.
Domain.com/Users/IT --> Email Signature Template IT1.
Domain.com/Users/Marketing --> Email Signature Template MRK1.

How to do that based on each OU ?

Note, the users are using various different OS and Office product like:
Operating System: Windows 7 and Windows 10
MS Office: 2010, 2013 and 2016 (some will use 64 bit, but majority is 32 bit)

Any help and guidance will be greatly appreciated,

Thanks,
Avatar of Antzs
Antzs
Flag of Malaysia image

If your signature only contain text, you can use the mail flows rules in Exchange and set the respective signatures.

But, if you need to insert picture in your signature.  The only way is to use those email signature software such as the below.

https://www.exclaimer.com
https://www.codetwo.com/
Avatar of Albert Widjaja

ASKER

No, I don't want to buy any software.
I just need the script and the group policy settings.
I was also looking at some script and GPO to accomplish this last year.  But all I got was that this is not supported.  

Software is the only way this will work if picture are involved.
here is a sample and not exactly what you are looking for, but it is a start  
script you can modify

clear
Import-Module ActiveDirectory 
$attrs = Import-Csv -Path C:\users\xxxxx\Downloads\summers.csv | %{Get-ADUser -Identity $_.samaccountname -Properties attrs = Get-ADUser -Identity joe -Properties * 
#$i = xxxxx 
foreach ( $attr in $attrs)
{

#$i = $i + xxxxx

#$filename = $attr.Sn + ', ' + $attr.GivenName
$filename = 'xxxxx Partners LLP'
#$filePath = "C:\Users\xxxxx\Downloads\Signture\" + $filename
$filepath = '\\netappxxxxxxxxxx\UserData\Profile\' + $attr.SamAccountName + '\UPM_Profile\AppData\Roaming\Microsoft\Signatures'
#$openfile = $filePath +'\'+ $filename +'.docx'

If(-not(Test-path -Path $filePath))
    { New-Item $filePath -type Directory}
    Else
    {"Directory already exist"}
 
#[ref]$SaveFormat = "microsoft.office.interop.word.WdSaveFormat" -as [type]
$word = New-Object -ComObject word.application
$word.visible = $false
$doc = $word.documents.add()

$selection = $word.selection
#$selection.WholeStory
$selection.Style = "No Spacing"


$selection.font.size = xxxxxxxxxx
$selection.font.name = 'Arial'
$selection.font.bold = xxxxx
$selection.typeText($attr.GivenName + ' ' + $attr.sn )
$selection.TypeParagraph()
$selection.TypeText($attr.title)

$selection.TypeParagraph()
$selection.TypeParagraph()
$selection.font.bold = xxxxx
$selection.font.size = xxxxxxxxxx
$selection.typeText("xxxxx Partners LLP")


$selection.TypeParagraph()
$selection.font.bold = xxxxx
$selection.font.size = xxxxxxxxxx
$selection.typeText($attr.StreetAddress)

$selection.TypeParagraph()
$selection.typeText($attr.City +  ', ' + $attr.State + ' ' + $attr.PostalCode)
$selection.TypeParagraph()
Switch ($attr.state) 
    {
      'NY'{$selection.TypeText('+xxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx Main')}
      'DC'{$selection.TypeText('+xxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx Main')}
      'MA'{$selection.typetext('+xxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx Main')}
    }
#If ($attr.state -eq 'NY')
#{
#$selection.TypeText('+xxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx Main')
#} 
#ElseIF ($attr.state = 'DC')
#{
#$selection.TypeText('+xxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx Main')
#}
#Elseif ($attr.state = 'MA')
#{
#$selection.typetext('+xxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx Main')
#}
$selection.TypeParagraph()
$selection.TypeText('+xxxxx ' + $attr.telephoneNumber.Replace('-','.') + ' Direct')
$selection.TypeParagraph()
$selection.TypeParagraph()
$email = $attr.mail

$selection.typetext($email)
$selection.TypeParagraph()
$selection.TypeText('www.xxxxxpartners.com')
#$selection.inlineShapes.AddPicture("C:\Users\xxxxx\Pictures\Test.jpg")



#Start-Sleep -s xxxxx
#$doc.saveas([ref] $openFILE)
#$doc.close()
#$word.Quit()
#$openfile
#Start-Sleep -s xxxxx
#$word = New-Object -ComObject word.application
#$word.visible = $true
#$word.Documents.open($openfile)

#$openfile = $filePath +'\'+ $filename + '.RTF'
$openfile = $filePath+'\'+$filename +'.RTF'
$doc.saveas([ref] $openfile , [ref] xxxxx)
$openfile = $filePath+'\'+$filename + '.htm'
$doc.SaveAs([ref] $openfile , [ref] xxxxx )
$openfile = $filePath+'\'+$filename +'.TXT'
$doc.saveas([ref] $openfile, [ref] xxxxx )

$doc.close()
$word.Quit()

#Start-Sleep -s xxxxx
$acl = Get-Acl $filePath
#$user = 'flhlaw\'+ $attr.SamAccountName

get-ChildItem $filePath -Recurse | Set-Acl -AclObject $Acl

#$filePath+'\'+$filename +'.RTF
#$filePath+'\'+$filename +'.htm
#$filePath+'\'+$filename +'.txt
}

Open in new window

Thanks for the reply,

not sure what to modify and how to set the GPO settings to make it in effect ?
I am not at my computer for the weekend so it would be a bit tough for me to work up. If you can wait until Monday I will be more than happy to help is no one else response.
Before I start working this up are you looking to apply this across your entire domain and what are you criteria's that you want populated based on the OU?

e.g.
Fullname
Company Name
Department
Title
direct number
cell number
etc.......
Yes, that's correct yobee.
For each OU the HTML template is differrent (diferent departemen signature.).
You can have a domain wide script that queries the OU and on that criteria the signature is created.

To help you work this up please give me the static and dynamic fields you want in your signature.
Dynamic:
First Name
Position / Title
City
Email address
Phone number

Static:
... Fax
Address
SOLUTION
Avatar of Adam the 32-bit Aardvark
Adam the 32-bit Aardvark
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yo_Bee,

Thanks for the assistant, somehow the script does not work for Office 2016 or 365 client ?

In Office 2013 below or older, it works. Do I need to do something to edit the script or load some ADMX in the Active Directory ?
Do you have a think client version of office on your computer?
No, it is Office ProPlus 2016 that does not work ?
Let me see what the script is doing and I will get back to you
Can you verify that the signature files are getting created in the %appdata%\Microsoft\Signature location?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How did you get it to work?
You never replied back to my question of if the files were even created.
I think the part that you are not seeing is the registry write due to the version of Office and the logic that is applied from LINES  192 - 243

This part is using logic to see if the version you are on and were to commit the registry settings.
you will need to copy lines 215-243 and replace 15.0 with 16.0 all the lines you copied.  Once you have done this you will have a script that will work for 2010,2013,2016.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Split:
-- yo_bee (https:#a42265143)
-- Senior IT System Engineer (https:#a42274790)
-- CodeTwo Software (https:#a42264726)


If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Pber
Experts-Exchange Cleanup Volunteer