Script to set Outlook 2010/2013 signature using AD information - Version 2.4

This Powershell script will gather information from AD and automatically populate the fields in the signature. Possible to manage signature versions and set editable or non-editable signatures.

 
 
 
 
 
4.9 Star
(17)
9,052 times
Add to favorites
Office
8/16/2015
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Nice work
    1 Posts | Last post May 17, 2017
    • This is an awesome script.  Found a few typos, few extra unused variables, and had to modify template and add a few fields, and change reg keys for outlook 2016 but so far so good.  Nice work!  Tested with Outlook 2016 / Windows 10.
      
  • windows 10 office 2007
    1 Posts | Last post May 16, 2017
    • how can i run the script with windows 10 and office 2007?
      the txt and the htm signature are not readable
                                                 
  • include banner by url
    1 Posts | Last post February 06, 2017
    • Is possible to add a banner by url ??. A picture hanging in internet.
  • Forced or Not Forced based on AD Group
    1 Posts | Last post February 06, 2017
    • I made this too allow me to have a ad group that would be queried to allow some users not have there signature forced. 
      
      #Forced or not OutlookSignature add or remove user form AD group OutlookSignature
      $UserName = $env:username
      $groupOutlook = "OutlookSignature"
      $members = Get-ADGroupMember -Identity $groupOutlook -Recursive | Select -ExpandProperty samAccountName
      
      If ($members -contains $UserName) {
      	Write-Output "Setting signature for Office 2013"
      	Remove-ItemProperty -Name 'NewSignature' -Path HKCU:'\Software\Microsoft\Office\15.0\Common\MailSettings' 
      	Remove-ItemProperty -Name 'ReplySignature' -Path HKCU:'\Software\Microsoft\Office\15.0\Common\MailSettings'
          
      	} Else {
        
      	Write-Output "Setting signature for Office 2013 as forced"
          New-ItemProperty HKCU:'\Software\Microsoft\Office\15.0\Common\MailSettings' -Name 'NewSignature' -Value 'COMAPANY NAME' -PropertyType 'String' -Force 
          New-ItemProperty HKCU:'\Software\Microsoft\Office\15.0\Common\MailSettings' -Name 'ReplySignature' -Value 'COMAPANY NAME' -PropertyType 'String' -Force
          } 
      
      i have added it in twice, start were you check versions, and and end where after creating signature. Maybe there is a way to do it once?
  • Remove empty lines
    2 Posts | Last post January 09, 2017
    • It is possible remove empty lines like phoneNumber?
    • I solved this like this:
      
      If ($ADTelephoneNumber -ne "") { 
      	$FindText = "Telefonnummer"
      	$ReplaceText = $ADTelephoneNumber.ToString()
         }
      Else {
      	$FindText = "Telefon : Telefonnummer`v"
              $ReplaceText = "".ToString()
      }
      
      `v means new line. In this way the whole line will be replaced by nothing if there is no telephone number set for a user in AD.
      
  • Is it possible to add a hyperlink to a value?
    2 Posts | Last post October 27, 2016
    • Has anyone a idea how i can add the correct hyperlink to the signature?
      For example to the E-mail-Adress or Website ?
    • Thats it:
      
      $MSWord.Selection.Find.Execute($FindText, $True, $MatchWholeWord,	$MatchWildcards, $MatchSoundsLike, $MatchAllWordForms, $Forward, $Wrap,    $Format, $ReplaceText, $ReplaceAll	)
      if ($MSWord.Selection.Find.Execute($ReplaceText.ToString())) {
        $MSWord.ActiveDocument.Hyperlinks.Add($MSWord.Selection.Range, "mailto:"+$ReplaceText.ToString(), $missing, $missing, $ReplaceText.ToString())
  • Windows 10 with AppLocker
    2 Posts | Last post August 02, 2016
    • Thanks for your script. Working great under Windows 7, but our windows 10 users are not getting anything. It seems to be this section "$ADUser = $ADUserPath.GetDirectoryEntry()" that i get this ERROR "Cannot invoke method. Method invocation is supported only on core types in this language mode.
      At line:1 char:1
      + $ADUser = $ADUserPath.GetDirectoryEntry()
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage" I tried to google the problem, and seen some Applocker stuff. We use AppLocker. Do you have any ideas?
      
      Thanks.
    • Had to applocker the script to work for me.
  • Remove ForceSignature
    2 Posts | Last post July 26, 2016
    • HI
      
      Wondering how you remove the ForceSignature. I can change the script to 0 but that doesnt change anything in the reg.
    • found it [HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\MailSettings]
      "NewSignature"="Standard Signature"
      "ReplySignature"="Standard Signature"
      
      Thinking option to allow you to change this within the script would be great.
  • Deploy the script
    1 Posts | Last post January 14, 2016
    • Hi,
      
      I want deploy this script in my AD Development, what can i do first?
      
      thank you.
  • how do you get outlook/word to quit once this script is done running?
    2 Posts | Last post November 30, 2015
    • I have them both running in background and nothing seems to work stopping them.  The sigs are not available until a reboot..is there a graceful quit command that could be added to the script so they are available immediately?  
    • Nevermind...I just add kill commands and it solved the issue...it left a trailing ~ word document but thats fine...
11 - 20 of 23 Items