Hi, I have an issue that users cant add aditonal signatures after getting this script. Anyone know what attribute i can change or add so this is the main and forced signature, but they can add additional signatures that they can switch between. Thanks
is it possible to remove the complete line when attribut is empty?
For example, if the signature file contains text Email or E-mail, replace that text with the variable $ADEmailAddress.
This is what I use to change hyperlinks: foreach($link in $MSWord.ActiveDocument.Hyperli nks) { if ($link.Address -like "https://www.go ogle.com/") { $link.Address = $ADURL.ToString () }elseif ($link.Address -like "https://www.fa cebook.com/") { $link.Address = $ADFB.ToString( ) }elseif ($link.Address -like "mailto:email") { $link.Address = "mailto:$ADEmai lAddress" } }
I hope someone can help, I have been using this script and has been working fine on windows 7. Recently got some new machines with Windows 10 and the script doesn't work on windows 10 machines. From the error, it's showing that the word (docx) file is not being opened. Can someone please help with this? Copying Signatures You cannot call a method on a null-valued expression. At \\ges.com\NETLOGON\sig_files\s et_outlook_sign ature2.ps1:76 char:1 + $MSWord.Documen ts.Open($fullPa th) + ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~ + CategoryInfo : InvalidOperatio n: (:) [], RuntimeExceptio n + FullyQualifiedE rrorId : InvokeMethodOnN ull You cannot call a method on a null-valued expression. At \\ges.com\NETLO GON\sig_files\s et_outlook_sign ature2.ps1:81 char:1 + $MSWord.Selecti on.Find.Execute ($FindText, $MatchCase, $MatchWholeWord ... + ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~ + CategoryInfo : InvalidOperatio n: (:) [], RuntimeExceptio n + FullyQualifiedE rrorId : InvokeMethodOnN ull
I worked on this script for Office 2016 and I noticed a few things. 1. The Downloaded script is not the same as the sample on the description page. If you download the script you will need to update the Office 2010, Office 2013 sections if you want the signatures to apply, but not be forced. 2. If you want the script to work for Office 2016 just append the following section. #Office 2016 signature If (Test-Path HKCU:Software\Microsoft\Office \16.0) { Write-Output "Setting signature for Office 2016" If ($ForceSignatur e -eq '0') { Write-Output "Setting Office 2016 as available" $MSWord = New-Object -ComObject word.applicatio n $EmailOptions = $MSWord.EmailOp tions $EmailSignature = $EmailOptions.E mailSignature $EmailSignature Entries = $EmailSignature .EmailSignature Entries $EmailSignature .NewMessageSign ature="$Signatu reName" $EmailSignature .ReplyMessageSi gnature="$Signa tureName" Stop-Process -Name $Outlook } If ($ForceSignatur e -eq '1') { Write-Output "Setting signature for Office 2016 as forced" If (Get-ItemProper ty -Name 'NewSignature' -Path HKCU:'\Software \Microsoft\Offi ce\16.0\Common\ MailSettings') { } Else { New-ItemPropert y HKCU:'\Software \Microsoft\Offi ce\16.0\Common\ MailSettings' -Name 'NewSignature' -Value $SignatureName -PropertyType 'String' -Force } If (Get-ItemProper ty -Name 'ReplySignature ' -Path HKCU:'\Software \Microsoft\Offi ce\16.0\Common\ MailSettings') { } Else { New-ItemPropert y HKCU:'\Software \Microsoft\Offi ce\16.0\Common\ MailSettings' -Name 'ReplySignature ' -Value $SignatureName -PropertyType 'String' -Force } } }
Hi there, Having issues removing the empty line should an AD record not have any information in that field. For instance if a user was missing a phone number it displays a empty line rather than moving the next line up. Any help appreciated.
Greetings. Thanks Daniel for the script, it works for me with some particular modifications, but very good. However, how to perform this task but for users who only use OWA? Say for example those who have K1 license.
THis script just seems to create, how can we manage changes that happen in AD to recreate or update the sig files?
change the version number within the script and it will update users signatures but not that everyone's will not update not just selected people.
I just used the last modified date of the AD User as the folder name. Then if the AD attribute is updated it reruns the script... had to rearrange the script a little to put the AD attributes before the check, but that is a minor delay on the overall script.