Coder Social home page Coder Social logo

set-outlooksignatures / set-outlooksignatures Goto Github PK

View Code? Open in Web Editor NEW
280.0 17.0 24.0 11.64 MB

The open source gold standard to centrally manage and deploy email signatures and out-of-office replies for Outlook and Exchange

License: European Union Public License 1.2

PowerShell 77.73% HTML 21.68% C# 0.46% Batchfile 0.13%
outlook-signatures outlook outlook-web powershell signature signatures outlook-signature powershell-scripting enterprise exchange

set-outlooksignatures's Issues

Can't access local AD

Hi, I've tried running Set-OutlookSignatures for the first time.
The script throws an error while trying to access the on-prem AD. I believe this is happening because the forest name is identical to the domain name.

Output (sorry for the German verbose message - I don't think there's a way to easily change this, other than changing entire OS language...):

Enumerate domains @2023-08-16T10:53:15+02:00@
  User forest: contoso.com
    Child domain: a.contoso.com
    Child domain: b.contoso.com
    Child domain: c.contoso.com
    Child domain: d.contoso.com
    Child domain: e.contoso.com
    Child domain: f.contoso.com
    Child domain: g.contoso.com
    Child domain: h.contoso.com
    Child domain: i.contoso.com
    Child domain: j.contoso.com
    Child domain: k.contoso.com
    Child domain: l.contoso.com
  Trusted domain: contoso.com
AUSFÜHRLICH: Ausnahme beim Aufrufen von "Add" mit 2 Argument(en):  "Das Element wurde bereits hinzugefügt. Schlüssel im Wörterbuch: "contoso.com". Hinzuzufügender Schlüssel: "contoso.com"."
  Problem connecting to logged-in user's Active Directory (see verbose stream for error message).
  Assuming Graph/Entra ID/Azure AD from now on.

The issue is here: https://github.com/GruberMarkus/Set-utlookSignatures/blob/dfae4b37a84987ed76dc962b0fe52e29260019de/src_Set-OutlookSignatures/Set-OutlookSignatures.ps1#L1170

Debugging the $LookupDomainsToTrusts variable shows that it already contains contoso.com, which is then being added a second time, which leads to the above exception.

I was able to work around it like this:

if ( -not $LookupDomainsToTrusts[$TrustedDomain.properties.name]) {
    $LookupDomainsToTrusts.add($TrustedDomain.properties.name.tolower(), $TrustedDomain.properties.name.tolower())
}

But I'm not sure if this is the best approach. If you think it is, let me know and I'll create a PR.

Issue reading group membership on local AD

Hi again,

I'm having issues with retrieving group membership of the logged on user.

  • Setup is on-prem AD with mail in 365 connected to Azure.
  • The "main" domain I am working under is "bbb.domain.com"
  • User is member of local AD security group "Signature Test"
  • Same result with parameter IncludeMailboxForestDomainLocalGroups set to $true

"Get AD properties of each mailbox @2023-05-25T15:20:35+02:00@
Mailbox 'user.name'
Search for mailbox user object in domain/forest 'domain.com': Not found
Mailbox 'user.name'
Mailbox user object already searched before, using cached data"
...
Group: Mailbox is not member of any allowed group"

log.txt

Best regards,
Peter

You create a .docx template but your variables don't populate

Just spent hours conquering this issue. Using verbose mode I was able to see my variables being retrieved but they were not replacing the placeholders in my signature. Finally I resolved this by trying (in Word):

Save As > Save as type > Strict Open XML Document (*.docx)

Something to try if you are having issues.

V3.6 and Office 2013 : issue with pictures and src value in htm file

Hi Markus
Since version 3.6, I notice an issue on PC with Office 2013.

Templates are docx files.
With 2013, pictures are in a separate folder, "Signature.htm + Signature.files/"
Pictures are called in the htm file with the "src" attribute.
Here are the differences between src attribute in htm generated file:

  • V3.51 : src="Signature.files/image002.png" 👍
  • V3.6 : src="1592677f-8f19-4360-81b3-83162ebdeefeHighRes_fichiers/image002.png" 👎

Of course, there is no folder nammed 1592677f-8f19-4360-81b3-83162ebdeefeHighRes_fichiers
With Office 2016, pics are integrated in the htm file, so it's OK.

I had to roll back to v 3.51.

If you need more infos, just ask.

Regards
Tom

Outlook 2013 registry keys and embedded images (original title: 'Nothing happens')

Hi
As I said on reddit's thread I can't get the script working.
As you suggested, I ran it without any parameter and no file is created (neither in the user's signature folder nor in documents subfolder) even if it pretends so at the end.

I see no error in the console, the replacement variables seem OK but there are some warnings :

'MyCompany external English formal Legal.[defaultNew] [Domain Legal-Group].docx'
Group specific signature
[Domain Legal-Group] = Domain\Legal-Group: Not found, please check
Default signature for new mails
'MyCompany external English formal Marketing Christmas 2021.[Domain Marketing-Group] [202112150000-202112262359].docx'
Time based signature
[202112150000-202112262359]: Current DateTime in range
Current DateTime is in range of at least one DateTime tag, using signature
Group specific signature
[Domain Marketing-Group] = Domain\Marketing-Group: Not found, please check
'MyCompany external English formal Marketing New Year 2022.[Domain Marketing-Group] [202112270000-202201062359].docx'
Time based signature
[202112270000-202201062359]: Current DateTime out of range
Current DateTime is not in range of any DateTime tag, ignoring signature
'MyCompany external English formal Marketing.[Domain Marketing-Group].docx'
Group specific signature
[Domain Marketing-Group] = Domain\Marketing-Group: Not found, please check
'MyCompany external English formal.[defaultNew].docx'
Common signature

Further information
OS : Windows 10
office : 2013 std
PS in full language mode

Thanx for helping ;)
Tom

Problem with signature in Outlook Web (OWA)

We have set up Set-OutlookSignatures to enable syncing to Outlook Web. The signatures are syncing, but Swedish characters (å, ä, ö) is replaced with garbage characters (ä is replaced by ä, for example). The local html file is correct when viewing in browser and Outlook client.

Also, images in the signature does not sync to Outlook web. I can see that the corresponding html folder name ends with '.files' and not '-filer' as is the Swedish default. I suspect that is why. If I use '-EmbedImagesInHtml $true', then the image is synced.

Thanks in advance,
Pär

Signatures in Outlook Web (OWA) not working

Hi, thanks for your awesome tool!
Signatures + OOF are working excellent for my local Outlook client.

Sadly it does not create the signatures in OWA.
OOF works fine in OWA.

It also does not delete the user created signatures in OWA.

powershell.exe -file .\Set-OutlookSignatures.ps1 -DeleteUserCreatedSignatures $true -GraphOnly $true -Verbose
  Set up environment for connection to Outlook Web @2023-06-01T11:15:29+02:00@
  Connect to Outlook Web @2023-06-01T11:15:29+02:00@
  Set Outlook Web signature @2023-06-01T11:15:50+02:00@
    Different default signatures for new and reply/forward set, use new one: 'MyCompany external English formal'
  Process Out of Office (OOF) auto replies @2023-06-01T11:15:50+02:00@
    Process common templates @2023-06-01T11:15:50+02:00@
      'MyCompany OOF external.docx' (ini index #3) @2023-06-01T11:15:50+02:00@
        Check permissions
          Allows
            Common: Template is classified as common template valid for all mailboxes
          Denies
            Group: Mailbox is not member of any denied group
            E-Mail address: Mailbox does not have any denied e-mail address
          Use template as there is at least one allow and no deny for this mailbox
      'MyCompany OOF internal.docx' (ini index #4) @2023-06-01T11:15:50+02:00@
        Check permissions
          Allows
            Common: Template is classified as common template valid for all mailboxes
          Denies
            Group: Mailbox is not member of any denied group
            E-Mail address: Mailbox does not have any denied e-mail address
          Use template as there is at least one allow and no deny for this mailbox
    Process group specific templates @2023-06-01T11:15:50+02:00@
      'MyCompany OOF external Legal.docx' (ini index #6) @2023-06-01T11:15:50+02:00@
        Check permissions
          Allows
            Group: Mailbox is not member of any allowed group
          Do not use template as there is no allow or at least one deny for this mailbox
      'MyCompany OOF external Marketing.docx' (ini index #7) @2023-06-01T11:15:50+02:00@
        Check permissions
          Allows
            Group: Mailbox is not member of any allowed group
          Do not use template as there is no allow or at least one deny for this mailbox
    Process mailbox specific templates @2023-06-01T11:15:50+02:00@
      'MyCompany OOF external Helpdesk.docx' (ini index #5) @2023-06-01T11:15:50+02:00@
        Check permissions
          Allows
            E-mail address: Mailbox does not have any allowed e-mail address
          Do not use template as there is no allow or at least one deny for this mailbox
    Convert final OOF templates to HTM format @2023-06-01T11:15:50+02:00@
      Internal OOF message: 'MyCompany OOF internal.docx' @2023-06-01T11:15:50+02:00@
        Create temporary file copy
        Replace picture variables
        Replace non-picture variables
        Export to HTM format
          Export high-res images
          Add marker to final HTM file
          Modify connected folder name
        Remove temporary files
      External OOF message: 'MyCompany OOF external.docx' @2023-06-01T11:15:52+02:00@
        Create temporary file copy
        Replace picture variables
        Replace non-picture variables
        Export to HTM format
          Export high-res images
          Add marker to final HTM file
          Modify connected folder name
        Remove temporary files
    Set Out of Office (OOF) auto replies @2023-06-01T11:15:53+02:00@

image

image

Conversion to Base64 is slow, slowing embedding images and loading Graph config file

With v4.8.0, Set-OutlookSignatures introduces the option to configure a custom HTML site to be displayed after the successful or unsuccessful authentication to Graph.

The "default graph config.ps1" file contains samples for this HTML code, and shows how to embed images.

Since this feature has been introduced, the load time of the default graph config file is much higher - on several of my systems, it takes 14 seconds longer than in older releases.

The reason for this is the way how images are converted to Base64 strings for embedding.

The actual conversion happens through calling [System.Convert]::ToBase64String(), and this is very fast.

What is slow is reading the image files content and converting it to a byte array.
Currently, Get-Content '.\path\to\file.png' is used with the -Encoding Byte (PowerShell Desktop) or -AsByteStream (PowerShell Core) parameter. This turns out to be very slow, because PowerShell converts every single byte to the [object] type first.

This can be solved by not relying on PowerShell cmdlets to get the file content as byte array, but using the .Net method [System.IO.File]::ReadAllBytes() instead.

Reading all bytes of the Set-OutlookSignatures logo with Get-Content roughly takes 7 seconds, while ReadAllBytes() gives the same in less than 0.2 seconds.

The way around this performance issue is to switch from Get-Content to ReadAllBytes().

Error positional parameter

Just uploaded v3.3.0-alpha2 and executed the script and got the following error:

Unexpected error. Exit.
Remove-Item : A positional parameter cannot be found that accepts argument 'System.__ComObject'.
At C:\drivers\desktops\Set-OutlookSignatures\Set-OutlookSignatures.ps1:2663 char:29
+ ...             Remove-Item (Join-Path -Path (Split-Path $path) -ChildPat ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Remove-Item], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Also attaching a verbose output:
SetSig.txt

Word not installed or not working correctly. Exit.

Hi,

I'm trying to setup company-wide Outlook signatures, but on my machine Set-OutlookSignatures 4.7.0 can't find Word, although it's installed and works normally.

What I get is:

Start Word background process @2023-11-10T19:50:52+01:00@
VERBOSE:   WordProcessPriority: 'Normal' ('32')
VERBOSE: The source code was already compiled and loaded.
  Word not installed or not working correctly. Exit.

InvalidOperation: C:\Users\XXX\Downloads\Set-OutlookSignatures_v4.7.0\Set-OutlookSignatures.ps1:2751
Line |
2751 |  … """ | ForEach-Object { $null = $_.SetPriority($WordProcessPriority) }
     |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Method invocation failed because [Deserialized.System.Management.ManagementObject#root\cimv2\Win32_Process] does
     | not contain a method named 'SetPriority'.

In issue #80 you mention a PS script to detect Word. I run it and I get WordFilePath: C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE.

I can start Word if I launch that command.

.txt signatures contain additional blank lines

When using .docx template files, the resulting text-only signature (.txt file) has additional blank lines at the end.

These blank lines do not appear when using .htm template files.

The problem is reproducable with the latest version (v2.1.2) of the script, the attached sample templates in .docx format can be used to demonstrate the problem.

User query LDAP successfully but still get a message about graph and tokens.

I am deploying the tool on a couple of test PC without any issue. We have a local AD and all the PC can do the ldap query correctly. Signatures are working fine. But i have 1 user that is trying to connect to Graph and i am not sure why.

usually after the line : Currently logged-in user, i get the logged on user and the manager and the script continue. But this user get a message about the graph token and it open a webpage to use the Enterprise Apps. I do not want to use MS-Graph but it only does this on this one user.

What am i missing ?


`Enumerate domains @2024-03-08T10:03:55-05:00@
  User forest:  $NameofDomainRedacted
  User provided trusted domain/forest:   $NameofDomainRedacted
    Trusted domain/forest already in list.

Check trusts for open LDAP port and connectivity @2024-03-08T10:03:55-05:00@
  $NameofDomainRedacted
    LDAP query successful

Check trusts for open Global Catalog port and connectivity @2024-03-08T10:03:56-05:00@
  $NameofDomainRedacted
    GC query successful

Get AD properties of currently logged-in user and assigned manager @2024-03-08T10:03:56-05:00@
  Currently logged-in user
    Set up environment for connection to Microsoft Graph @2024-03-08T10:03:56-05:00@
VERBOSE: Loading module from path
'C:\Users\REDACTED\AppData\Local\Temp\c97801ce-b4be-4e71-9983-9f12707483d3\msal.ps\msal.ps.psd1'.
VERBOSE: Loading module from path
'C:\Users\REDACTED\AppData\Local\Temp\c97801ce-b4be-4e71-9983-9f12707483d3\msal.ps\MSAL.PS.psm1'.
VERBOSE: Exporting function 'Assert-DirectoryExists'.
VERBOSE: Exporting function 'ConvertFrom-SecureStringAsPlainText'.`

v3.6.0 does not find all Outlook mailboxes

Discussed in #74

Originally posted by KoenBouten April 28, 2023
Hello Markus,

Here you have the text file with the output of the 3.6.0 script which you asked for last time.

But there was one thing I found in the meantime:

3.3.0 = line 748
3.6.0 = line 744
The script displays things in a different order/way at this part.
(domainD.local is a one-way-domain-trust & domainH.nl is a forrest-trust)

I hope this will be enough information.

Script output V3.6.txt
Script OutputV3.3.txt

Error from WINWORD, library not registered

Hi Markus !
On a few bunch of machines (Win 10, Office 2013) the script raises an error when Word has to open the docx model and process it to create the signatures.

'Get all OOF template files and categorize them @2022-04-13T09:51:29+02:00@

Start Word background process for template editing @2022-04-13T09:51:29+02:00@
Word not installed or not working correctly. Exiting.
Exception lors de l'appel de «Quit» avec «1» argument(s): «Impossible d'effectuer un cast d'un objet COM de type
'Microsoft.Office.Interop.Word.ApplicationClass' en type d'interface 'Microsoft.Office.Interop.Word._Application'.
Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID
'{00020970-0000-0000-C000-000000000046}' a échoué en raison de l'erreur suivante: Bibliothèque non inscrite.
(Exception de HRESULT : 0x8002801D (TYPE_E_LIBNOTREGISTERED)).»
Au caractère C:\Logiciels\Set-OutlookSignatures\Set-OutlookSignatures.ps1:1486 : 17
+ $script:COMWordDummy.Quit([ref]$false)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidCastException

Clean-up @2022-04-13T09:51:30+02:00@'

I think this issue is MS related, but have you ever heard about this and what to do ?

Of course, I tried lots of things (including the use of a MS tool aimed to make a full clean of Office prior to reinstall it...

Thanx Markus !

Adding option for users to not have Photo in signature

Although all users have photos in AzureAD we have a few that do not want to have their photo in the signature.
I tried adding a code to a extensionattribute and used the following in the custom replacement file:

$ReplaceHash['$CURRENTUSERPHOTODELETEEMPTY$'] = if ($ADPropsCurrentUser.extensionattribute4.Contains("np")) {""}else{$ADPropsCurrentUser.thumbnailphoto}

But it seems to have no effect, the photo is still being loaded.
script-output.txt

Script is getting "Currently logged-in user" wrong?

Hello there,
I just discovered this project and would like to implement it for our company (being the administrator).
Exchange online, local AD, synced attributes.

Trying the quick start guide, I get the following problem when running "powershell.exe -file "Set-OutlookSignatures.ps1" for the first time.

Get AD properties of currently logged-in user and assigned manager @2023-11-24T13:23:07+01:00@
Currently logged-in user
Set up environment for connection to Microsoft Graph @2023-11-24T13:23:11+01:00@
Execute config file 'C:\Users\derGali\Downloads\Set-OutlookSignatures_v4.8.0\config\default graph config.ps1'
MSAL.PS Graph token cache: 'C:\Users\derGali\AppData\Local\MSAL.PS\MSAL.PS.msalcache.bin3'
Problem getting data for '[email protected]' from Microsoft Graph. Exit.
Invoke-RestMethod : Der Remoteserver hat einen Fehler zurückgegeben: (404) Nicht gefunden.
In C:\Users\derGali\Downloads\Set-OutlookSignatures_v4.8.0\Set-OutlookSignatures.ps1:5397 Zeichen:39
+ $local:pagedResults = Invoke-RestMethod @requestBody
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Clean-up @2023-11-24T13:23:30+01:00@

Why does the script think the "currently logged-in user" is my seperate ms365-admin user (without a mailbox or even license) when this user is currently not logged in windows locally nor in any browser?

I also tried the del "%LocalAppData%\MSAL.PS\MSAL.PS.msalcache.bin3" command already.

What am I doing wrong?

(in simulation mode, with my correct user, it works!)

Outlook Signatures not working in OWA

Hello Markus,

we have implemented Set-OutlookSignatures script in organisation and it works fine for Outlook users. However, after running script with SetCurrentUserOutlookWebSignature parameter set to true only Outlook signature is generated while OWA signature is not. We have tried it on multiple users and Windows 10/11 computers.

Best Regards

Haris Alatovic

Custom Signature Template

I have made a .htm template file and put it into a directory of Main under templates, this is how I did it under v2.5.2 and it worked just fine except for the extendedattributes issue that you solve earlier. But now when I run the new v3.2.1-beta1 script I am getting the following.

Get all signature template files and categorize them @2022-07-26T16:06:54-07:00@
'sig-master.htm' (ini index #)

Unexpected error. Exit.
Index operation failed; the array index evaluated to null.
At C:\Users\bhagler\Desktop\Set-OutlookSignatures_v3.2.1-beta1\Set-OutlookSignatures.ps1:1236 char:17

  • ... if ($TemplateIniSettings[$TemplateIniSettingsIndex]['<Set-Out ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArrayIndex

Issue with images not embedded

Hi Markus
Happy new year to you !

I discovered an issue with the signatures using the embedded image param at $false.
In Outlook 2013, the signature appears correctly, if I open the htm file, I can see the picture too.
Here's the issue :

  • If I send from Outlook 2013, the recipients won't see the image (whatever they are using Outlook, web Outlook or even Gmail)
  • If I send from the Web Outlook, it's OK

The issue appears event with the "Test all signature replacement variables.docx".

The remote procedure call failed

Dear community,

Many thanks for this awesome project!

I just started playing around with the script and, when using the defaults, I am hitting the error below. Any hints?

  Process common templates @2024-04-22T16:07:21+01:00@
    'Int infrml.docx' (Signature ini index #4) @2024-04-22T16:07:21+01:00@
      Check permissions
        Allows
          Common: Template is classified as common template valid for all mailboxes
        Denies
          No group match for current mailbox, checking current user specific denies
          Group: Mailbox and current user are not member of any denied group
          No email address match for current mailbox, checking current user specific denies
          Email address: Mailbox and current user do not have any denied email address
          Replacement variable: No deny replacement variable evaluates to true
        Use template as there is at least one allow and no deny
      Outlook signature name: 'Int infrml'
      Create temporary file copy
      Replace picture variables
      Replace non-picture variables
      Export to HTM format

Unexpected error. Exit.
The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
At C:\temp\Set-OutlookSignatures_v4.11.0\Set-OutlookSignatures.ps1:5031 char:13
+             $script:COMWord.ActiveDocument.WebOptions.TargetBrowser = ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException


Clean-up @2024-04-22T16:07:52+01:00@
Exception calling "Quit" with "1" argument(s): "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
At C:\temp\Set-OutlookSignatures_v4.11.0\Set-OutlookSignatures.ps1:6684 char:9
+         $script:COMWord.Quit([ref]$false)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : COMException

VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT * FROM
Win32_process WHERE ProcessId = "2652",'queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''instance' = Win32_Process: powershell.exe
(Handle = "2652"),'methodName' = SetPriority,'namespaceName' = root/cimv2'.
VERBOSE: Operation 'Query CimInstances' complete.
VERBOSE: Operation 'Invoke CimMethod' complete.

End script @2024-04-22T16:07:52+01:00@
PS C:\temp\Set-OutlookSignatures_v4.11.0>

Thanks for your help!

Bruno Martins

Access to the cloud file denied

Rolled out Set-OutlookSignatures to a new user and got the following error:

Copy signatures to AdditionalSignaturePath @2022-08-10T09:11:17-04:00@
  'C:\Users\jvogel\OneDrive - Developer's Mortgage Company\Documents 2\Documents\Outlook Signatures'
PS>TerminatingError(Remove-Item): "Access to the cloud file is denied"
>> TerminatingError(Remove-Item): "Access to the cloud file is denied"

Unexpected error. Exit.
Remove-Item : Access to the cloud file is denied
At C:\drivers\desktops\Set-OutlookSignatures\Set-OutlookSignatures.ps1:2138 char:91
+ ... .fullname | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-Item], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand


Clean-up @2022-08-10T09:11:17-04:00@

End script @2022-08-10T09:11:17-04:00@

ExtensionAttributes are all null

I have information in extended attributes and can see them using Microsofts Graph Explorer:
image

But when running the script they always come back empty
Screen Shot 2022-07-26 at 9 14 53 AM

I see that you had addressed the same issue earlier:
image

I am using the latest build from you, v3.2.0
This is happing on all users, I am at a standstill rolling this out, any help would be greatly appreciated.

$CURRENTUSERTELEPHONE$ not being populated from graph

Using v2.4.0 and $CURRENTUSERTELEPHONE$ is not being populated using -graphonly $true. Checked using graph explorer and can see the value for the test user as per below. No errors when running.

"businessPhones": [
"+44 1234567890 x123"
]

LDAP and GC connectivity checks take long time to fail

When an LDAP or GC port between client and domain are open, the script checks for LDAP and GC connectivity. This is done by issuing a LDAP or GC query asking for one (1) random user account.

If everything is fine, this query only takes about a second.

When the query fails (trust works, the ports are open, but selective authentication is enabled), the query runs into a timeout which takes 40 seconds or more.

The script uses DirectoryServices.DirectorySearcher and [adsi] for the connection test. ClientTimeout and ServerTimeLimit have no influence on the connection time-out, and there does not seem to be a separate connection time-out setting.

Script hanging at Connect to Outlook Web

Working to deploy corporate signatures and the script is hanging when attempting to connect to outlook web. (output snip below)
The only thing I can do is ctrl-c and quit the script. Can you tell me why this might be happening?
...
Process mailbox specific templates @2024-05-02T15:25:32-04:00@
'VariablesTest.docx' (Signature ini index #3) @2024-05-02T15:25:32-04:00@
Check permissions
Allows
No email address match for current mailbox, checking current user specific allows
Email address: Mailbox and current user do not have any allowed email address
Do not use template as there is no allow or at least one deny
Process replacementvariable specific templates @2024-05-02T15:25:32-04:00@
Set up environment for connection to Outlook Web @2024-05-02T15:25:32-04:00@
Connect to Outlook Web
...

Using the following options when starting the script (I have replaced actual fileserver name and share)

& '\fileserver\share\OutlookSignatureTemplate\set-outlooksignatures.ps1' -SignatureTemplatePath "\\fileserver\share\OutlookSignatureTemplate\DOCX"
-SignatureIniPath '\fileserver\share\OutlookSignatureTemplate\Config_Signatures.ini' -OOFTemplatePath "\\fileserver\share\OutlookSignatureTemplate\OOF"
-OOFIniPath '\fileserver\share\OutlookSignatureTemplate\Config_OOF.ini' -GraphConfigFile '\\fileserver\share\OutlookSignatureTemplate\Config\GraphConfig.ps1'
-GraphOnly $false `
-ReplacementVariableConfigFile '\fileserver\share\OutlookSignatureTemplate\Config\ReplacementVars.ps1'

AngleSharp dependency

After implementing my workaround described in #83, I get another error when trying to set the signature:

      Export to HTM format
        Export high-res images
          The 'DocxHighResImageConversion' feature is reserved for Benefactor Circle members.
          Find out details in '.\docs\Benefactor Circle'.
        Copy HTM image width and height attributes to style attribute
AUSFÜHRLICH: Das in die Pipeline geschriebene Objekt ist eine Instanz vom Typ "mshtml.HTMLDocumentClass" aus der primären Interoperabilitätsassembly der Komponente. Wenn dieser Typ andere Elemente als die
IDispatch-Elemente verfügbar macht, funktionieren Skripts, die dieses Objekt verwenden, möglicherweise nicht, sofern die primäre Interoperabilitätsassembly nicht installiert ist.
        Move CSS inline

Unexpected error. Exit.
Ausnahme beim Abrufen des Elements "MoveCssInline": "Die Datei oder Assembly "AngleSharp, Version=0.16.1.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea" oder eine Abhängigkeit davon wurde nicht
gefunden. Das System kann die angegebene Datei nicht finden."
In C:\Users\pankratzf\Desktop\Set-OutlookSignatures_v4.2.0\Set-OutlookSignatures.ps1:3803 Zeichen:53
+ ... xt($path, $([PreMailer.Net.PreMailer]::MoveCssInline($tempFileContent ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException
    + FullyQualifiedErrorId : CatchFromBaseGetMember

So it seems like I'm missing a DLL? Not sure which one or where to get it, though.
Running the script with -MoveCSSInline $false works fine.

Signature not being set for new messages or replies/forwards, and is not displayed under Email Account in Signatures and Stationery

Firstly, apologies if i have missed something in your documentation. Your product is very feature rich, with a lot of configuration, its entirely possible i have missed something.

What I am finding is that after I have ran Set-OutlookSignatures.ps1 with a basic ini and 1 template file (very basic setup), the result in "%AppData%\Roaming\Microsoft\Signatures" is a folder following the naming convention "Nameofsig.files", along with 2 files, "Nameofsig.htm", and "Nameofsig.txt". When opening Outlook, and reviewing Outlook Options > Mail > Signatures and Stationery, with my email account selected, their are no signatures displayed, and nothing both available or set for New messages or Replies/forwards. if I change the option for email account from my email account to "Signatures on this device", the signature is displayed, but it still cant be manually set for new messages or replies/forwards.

If i manually create a signature, the files that are created under "%AppData%\Roaming\Microsoft\Signatures" follow the naming convention "Nameofsig.file ([email protected])", "Nameofsig.htm ([email protected])", and "Nameofsig.txt ([email protected])".

The shortest way to describe this is, outlook in my org appears to be expecting the something after the signature to be appended to the signature name. To further complicate this, this is not always lower case email address. My UPN have the firstname and surname capatilised, and this is how it shows in the signature folder, however i have another user who's upn is all lower case, yet for some reason outlook is creating them with a capital at the beginning of the names, and another user with a all lower case upn, whos signatures are created all lowercase. It don't know what outlook is using to determine what it appends to the sig name.

Would really appreciate your help.

many thanks, and happy christmas

Out-of-Office replies are not set when MailboxSpecificSignatureNames is enabled

Issue happens in the latest release

  • I confirm that the issue happens in the latest release of Set-OutlookSignatures

Previously solved issues and documentation

  • I have searched through previous issues and documentation, but have not found an answer to my issue

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

When the parameter MailboxSpecificSignatureNames is enabled, out-of-office replies were not set because of a mismatch of temporary file names.

The error, as shown in the verbose log, is:

Copy-Item : Cannot find path 'C:\Users\UserX\AppData\Local\Temp\a314b00d-a430-4f58-a753-b5a5b76f89b8\9ae5
a0d8-49c7-4ecd-9d0b-b025dc4f372e OOFInternal.htm' because it does not exist.

The two GUIDs in the file path are individual. 'OOFInternal.htm' may also be 'OOFExternal.htm'.


This is a known problem in v4.12.0. The root cause has already been identified and fixed.

The updated code will be part of the next (patch) release, which is not yet scheduled. Contact me if you need access to the updated code earlier.

Verbose log

Process out of office (OOF) auto replies @2024-05-08T12:13:53+02:00@
VERBOSE: SetCurrentUserOOFMessage
VERBOSE: CheckLicense
VERBOSE: CheckGroupMembership
VERBOSE: CheckGroupMembership currentMailboxIsExchange 'True'
VERBOSE: CheckGroupMembership GraphOnly/isCloud 'True'
VERBOSE: CheckGroupMembership currentMailboxDomainDns ''
VERBOSE: CheckGroupMembership Initial check
VERBOSE: CheckGroupMembership valueA 'true'
VERBOSE: CheckGroupMembership group checked before without error 'EntraID\S-1-12-1-4092616986-1192721342-1740227465-714274506'
    Process common templates @2024-05-08T12:13:54+02:00@
      'ext EN frml (user has no manager).docx' (OOF ini index #2) @2024-05-08T12:13:54+02:00@
        Check permissions
          Allows
            Common: Template is classified as common template valid for all mailboxes
          Denies
            No group match for current mailbox, checking current user specific denies
            Group: Mailbox and current user are not member of any denied group
            No email address match for current mailbox, checking current user specific denies
            Email address: Mailbox and current user do not have any denied email address
            Replacement variable: No deny replacement variable evaluates to true
          Use template as there is at least one allow and no deny
    Process group specific templates @2024-05-08T12:13:54+02:00@
      'OOF external.docx' (OOF ini index #3) @2024-05-08T12:13:54+02:00@
        Check permissions
          Allows
            No group match for current mailbox, checking current user specific allows
            Group: Mailbox and current user are not member of any allowed group
          Do not use template as there is no allow or at least one deny
      'OOF internal.docx' (OOF ini index #4) @2024-05-08T12:13:54+02:00@
        Check permissions
          Allows
            No group match for current mailbox, checking current user specific allows
            Group: Mailbox and current user are not member of any allowed group
          Do not use template as there is no allow or at least one deny
    Process mailbox specific templates @2024-05-08T12:13:54+02:00@
    Process replacementvariable specific templates @2024-05-08T12:13:54+02:00@
      'ext EN frml (user has manager).docx' (OOF ini index #1) @2024-05-08T12:13:54+02:00@
        Check permissions
          Allows
            Replacement variable: No allowed replacement variable evaluates to true
          Do not use template as there is no allow or at least one deny
      'ext EN frml (user has no manager).docx' (OOF ini index #2) @2024-05-08T12:13:54+02:00@
        Check permissions
          Allows
            Replacement variable: No allowed replacement variable evaluates to true
          Do not use template as there is no allow or at least one deny
    Convert final OOF templates to HTM format @2024-05-08T12:13:54+02:00@
      Common OOF message: 'ext EN frml (user has no manager).docx' @2024-05-08T12:13:54+02:00@
        Create temporary file copy
        Replace picture variables
        Replace non-picture variables
        Export to HTM format
          Export high-res images
VERBOSE: DocxHighResImageConversion
VERBOSE: CheckLicense
VERBOSE: CheckGroupMembership
VERBOSE: CheckGroupMembership currentMailboxIsExchange 'True'
VERBOSE: CheckGroupMembership GraphOnly/isCloud 'True'
VERBOSE: CheckGroupMembership currentMailboxDomainDns ''
VERBOSE: CheckGroupMembership Initial check
VERBOSE: CheckGroupMembership valueA 'true'
VERBOSE: CheckGroupMembership group checked before without error 'EntraID\S-1-12-1-4092616986-1192721342-1740227465-714274506'
VERBOSE: DocxHighResImageConversion Bind to existing COM instance
VERBOSE: DocxHighResImageConversion Load low res htm
VERBOSE: DocxHighResImageConversion low res total image count '0'
VERBOSE: DocxHighResImageConversion low res local image count '0'
          Copy HTM image width and height attributes to style attribute
          Move CSS inline
          Add marker to final HTM file
          Modify connected folder name
        Remove temporary files
Copy-Item : Cannot find path 'C:\Users\UserX\AppData\Local\Temp\a314b00d-a430-4f58-a753-b5a5b76f89b8\9ae5
a0d8-49c7-4ecd-9d0b-b025dc4f372e OOFInternal.htm' because it does not exist.
At \\server\share\Set-OutlookSignatures\Set-OutlookSignatures.ps1:4864 char:17
+ ...             Copy-Item -Path (Join-Path -Path $script:tempDir -ChildPa ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\UserX...OOFInternal.htm:String) [Copy-Item], 
ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
    Set out of office (OOF) auto replies @2024-05-08T12:13:56+02:00@

Get-Process : Es kann kein Prozess mit der Prozess-ID 2716 gefunden werden.

Hello,
for some (not all) users we are facing the following issue and the signature is not applied. Have you seen this issue before?

Thanks!
Ben

AUSFÜHRLICH: Funktion "Add-MsalClientApplication" wird importiert.
AUSFÜHRLICH: Funktion "Clear-MsalTokenCache" wird importiert.
AUSFÜHRLICH: Funktion "Enable-MsalTokenCacheOnDisk" wird importiert.
AUSFÜHRLICH: Funktion "Get-MsalAccount" wird importiert.
AUSFÜHRLICH: Funktion "Get-MsalClientApplication" wird importiert.
AUSFÜHRLICH: Funktion "Get-MsalFeatureSupport" wird importiert.
AUSFÜHRLICH: Funktion "Get-MsalToken" wird importiert.
AUSFÜHRLICH: Funktion "New-MsalClientApplication" wird importiert.
AUSFÜHRLICH: Funktion "Remove-MsalClientApplication" wird importiert.
AUSFÜHRLICH: Funktion "Select-MsalClientApplication" wird importiert.
Execute config file '\srv-muc-mgmt\Applications\Set-OutlookSignatures\Templates\Config\default graph config.ps1'
MSAL.PS Graph token cache: 'C:\Users\hank.schrader\AppData\Local\MSAL.PS\MSAL.PS.msalcache.bin3'
AUSFÜHRLICH: Current user:
AUSFÜHRLICH: Authentication
AUSFÜHRLICH: Via IntegratedWindowsAuth
AUSFÜHRLICH: Via Silent with LoginHint
AUSFÜHRLICH: Via Prompt with LoginHint and Timeout
Get-Process : Es kann kein Prozess mit der Prozess-ID 2716 gefunden werden.
In C:\Users\hank.schrader\AppData\Local\Temp\a7f53b53-8ebd-484f-b1f4-3bbebe759fdc\msal.ps\Get-MsalToken.ps1:262 Zeichen:42

  • ... ParentWindow = (Get-Process -Id $Win32Process.ParentProcessId).MainWi ...
  •                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (2716:Int32) [Get-Process], ProcessCommandException
    • FullyQualifiedErrorId : NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand

AUSFÜHRLICH: No authentication possible
Problem connecting to Microsoft Graph. Exit.
Die Eigenschaft "MainWindowHandle" wurde für dieses Objekt nicht gefunden. Vergewissern Sie sich, dass die Eigenschaft vorhanden ist.
In C:\Users\hank.schrader\AppData\Local\Temp\a7f53b53-8ebd-484f-b1f4-3bbebe759fdc\msal.ps\Get-MsalToken.ps1:262 Zeichen:25

  • ... $ParentWindow = (Get-Process -Id $Win32Process.ParentProc ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict

No authentication possible. Try:

  1. Delete MSAL.PS Graph token cache: 'C:\Users\hank.schrader\AppData\Local\MSAL.PS\MSAL.PS.msalcache.bin3'"
  2. Run Set-OutlookSignatures with the "-Verbose" parameter and check for authentication messages
  3. If the "Via Prompt with LoginHint and Timeout" authentication message is diplayed:

Clean-up @2023-10-16T11:19:42+02:00@
AUSFÜHRLICH: Die importierte Funktion "Add-MsalClientApplication" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Clear-MsalTokenCache" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Enable-MsalTokenCacheOnDisk" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Get-MsalAccount" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Get-MsalClientApplication" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Get-MsalFeatureSupport" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Get-MsalToken" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "New-MsalClientApplication" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Remove-MsalClientApplication" wird entfernt.
AUSFÜHRLICH: Die importierte Funktion "Select-MsalClientApplication" wird entfernt.

Passing empty value for AdditionalSignaturePath leads to error

Passing an empty value for parameter AdditionalSignaturePath leads to an error on line 744 of Set-OutlookSignatures.ps1 (v1.6.0).

Log output :
Script started
Script notes
Script: Set-OutlookSignatures.ps1
Version: 1.6.0
Author: Markus Gruber
License: MIT License (see license.txt for details and copyright)
Web: https://github.com/GruberMarkus/Set-OutlookSignatures
Check parameters and script environment
Script name: 'C:\ALexclude\Set-OutlookSignatures\Set-OutlookSignatures.ps1'
Script path: 'C:\ALexclude\Set-OutlookSignatures'
SignatureTemplatePath: '.\templates\Signatures DOCX'
ReplacementVariableConfigFile: '.\config\default replacement variables.txt'
DomainsToCheckForGroups: '*'
DeleteUserCreatedSignatures: 'False'
SetCurrentUserOutlookWebSignature: 'True'
SetCurrentUserOOFMessage: 'True'
OOFTemplatePath: '.\templates\Out of Office DOCX'
AdditionalSignaturePath: ''
AdditionalSignaturePathFolder: 'Outlook signatures'
Join-Path : Das Argument kann nicht an den Parameter "Path" gebunden werden, da es sich um eine leere Zeichenfolge
handelt.
In C:\ALexclude\Set-OutlookSignatures\Set-OutlookSignatures.ps1:744 Zeichen:49

  • ... onalSignaturePath = (Join-Path -Path $AdditionalSignaturePath -ChildP ...
  •                                      ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException

    • FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Join
      PathCommand

      Problem connecting to, creating or reading from folder ''. Deactivating feature.
      UseHtmTemplates: 'False'

Cannot bind parameter 'Path' to the target

This is on a new computer that has office 2016 installed

Start Word background process @2022-09-07T13:20:46-04:00@
PS>TerminatingError(Add-Type): "Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll' because it does not exist.""
  Word not installed or not working correctly. Exit.
Add-Type : Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path 'C:\WINDOWS\assembly
\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll' because it does
not exist."
At C:\drivers\desktops\Set-OutlookSignatures\Set-OutlookSignatures.ps1:1660 char:28
+ ... -Type -Path (Get-ChildItem -LiteralPath ((Join-Path -Path ($env:Syste ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Add-Type], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.AddTypeCommand

Here is the verbose output:
SetSig.txt

GraphGetUserTransitiveMemberOf is not paging aware

Hi, thanks for your effort on this tool!

We are using your tool and came across an isse with the GraphOnly option: If a user has enough groups so that the API response is paged, only the initial batch is fetched. This can be fixed by adding a while loop like this into the function


$InvokeRestMethod = Invoke-RestMethod @requestBody
$x = $InvokeRestMethod.value

while ($null -ne $($InvokeRestMethod."@odata.nextLink")) {
$requestBody = @{
Method = 'Get'
Uri = $($InvokeRestMethod."@odata.nextLink")
Headers = $script:authorizationHeader
ContentType = 'Application/Json; charset=utf-8'
}
$InvokeRestMethod = Invoke-RestMethod @requestBody
#$x.count
$x += $InvokeRestMethod.value
}

`

Mailbox is not member of any allowed group

image

i have the error above no legacyExchangeDN , is this error causing mailbox not member of allowed group ? i check my legacyExchangeDN is empty and my environment is Hybrid AD.

Trying to use New outlook but it try to connect to graph when it worked with Old Outlook

Using Powershell 5
"Powershell 7 64 bits does not find NewOutlook"

My account is not a remote mailbox.
My command does not have the -GraphOnly true
The registry UseNewOutlook is set to 1 in Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\Preferences

If i run the script using PS 5 or 7, with Old Outlook. It works, i have the signature and everything.
If i run the script using PS 5 with the New outlook, it finds the version of the new outlook "Version: 1.2024.313.100"
LDAP and QC Query are successful but then it tries to connect to Graph. Do we have to use Graph to use the New outlook or can we do it locally ?

Error i have :Unexpected error. Exit.
New-MsalClientApplication : Cannot bind argument to parameter 'ClientId' because it is an empty string.
Obviously because my graph is not setup because i do not want to use it.

Wrong version of Word detected

Hi Markus

On a TSE server, I have an issue with only one user, here's the log :
`**********************
Début de la transcription Windows Powershell
Heure de début : 20230605113727
Nom d'utilisateur : DOMAINE\d.xxxx
Utilisateur runAs : DOMAINE\d.xxxx
Ordinateur : TSE2016AA (Microsoft Windows NT 10.0.14393.0)
Application hôte : powershell.exe -WindowStyle Hidden -ExecutionPolicy ByPass -File C:\Logiciels\Scripts\Signatures.ps1
ID de processus : 19032
PSVersion: 5.1.14393.5127
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14393.5127
BuildVersion: 10.0.14393.5127
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Transcription démarrée, le fichier de sortie est C:\Users\d.xxxx\Signatures.log
OK : Settings disponible
ATTENTION : Lancement manuel
OK : Script disponible
OK : Fichier ini disponible
OK : Fichier de remplacement disponible
OK : Dosier des template disponible
OK : Dossier OOF disponible
OK : Fichier ini des OOF disponible
OK : Modèle de signature disponible
ATTENTION : L'image sera integrée
OK : Word et Outlook sont présents
OK : Donnée OK pour la valeur HKCU:\SOFTWARE\Microsoft\Office\16.0\Outlook\Options\Mail\Send Pictures With Document
ATTENTION : Mise à jour de la signature nécessaire

Start script @2023-06-05T11:37:28+02:00@

Script notes @2023-06-05T11:37:28+02:00@
Script : Set-OutlookSignatures
Version: v3.5.1
Web : https://github.com/GruberMarkus/Set-OutlookSignatures
License: MIT license (see '.\docs\LICENSE.txt' for details and copyright)

Check parameters and script environment @2023-06-05T11:37:28+02:00@
PowerShell: '5.1.14393.5127', 'Desktop'
PowerShell bitness: 64-bit process on a 64-bit operating system
PowerShell parameters: ' & $Script.f_OutlookSignatures -EmbedImagesInHTML $EmbedImagesInHTML -SetCurrentUserOOFMessage $false -SignatureTemplatePath $Script.d_templates -OOFTemplatePath $Script.d_OOF -SignatureIniPath $Script.f_Template_Ini -OOFIniPath $Script.f_OOF_Ini -ReplacementVariableConfigFile $Script.f_replacement -GraphConfigFile $Script.f_GraphConfigFile
'
Script path: 'C:\Logiciels\Set-OutlookSignatures\Set-OutlookSignatures.ps1'
TrustsToCheckForGroups: '*'
IncludeMailboxForestDomainLocalGroups: 'False'
SignatureTemplatePath: '\mercure\partage\Applicatifs\MAILS\Signatures'

SignatureIniPath: '\domaine.local\NETLOGON\Set-OutlookSignatures\INI\signatures.ini'

SetCurrentUserOutlookWebSignature: 'True'
SetCurrentUserOOFMessage: 'False'
UseHtmTemplates: 'False'
GraphOnly: 'False'
GraphConfigFile: 'C:\Logiciels\Set-OutlookSignatures\config\default graph config.ps1'

GraphCredentialFile: ''

ReplacementVariableConfigFile: '\domaine.local\NETLOGON\Set-OutlookSignatures\config\replacement variables - LaNormandise.ps1'

EmbedImagesInHtml: 'True'
CreateRtfSignatures: 'True'
CreateTxtSignatures: 'True'
DeleteUserCreatedSignatures: 'False'
DeleteScriptCreatedSignaturesWithoutTemplate: 'True'
SignaturesForAutomappedAndAdditionalMailboxes: 'True'
AdditionalSignaturePath: 'C:\Users\d.xxx\Documents\Outlook Signatures'

SimulateUser: ''
SimulateMailboxes: ''

Get basic Outlook and Word information @2023-06-05T11:37:28+02:00@
Outlook
Registry version: 16.0
File version: 16.0.5257.1000
Bitness: x86
Default profile: Outlook
Is C2R Beta: False
DisableRoamingSignaturesTemporaryToggle: 0
Word
Word version 12.0.0.0 is older than Word 2010 and not supported. Please inform your administrator. Exit.

Clean-up @2023-06-05T11:37:29+02:00@

End script @2023-06-05T11:37:29+02:00@


Fin de la transcription Windows PowerShell
Heure de fin : 20230605113729


`

Office 2016 Standard is installed

Implementation instruction

Hi Markus,
Your solution looks amazing. I would like to implement it in my organization. Is there maybe some kind of manual/guide how to implement Your solution? In file that are in zip i only saw technical requirements.

MsalToken problem on windows 10 and 11 computers

We are replacing computers and are running the script on new computers and are getting the following error:

      Execute config file 'C:\drivers\desktops\Set-OutlookSignatures\config\default graph config.ps1'
      MSAL.PS Graph token cache: 'C:\WINDOWS\system32\config\systemprofile\AppData\Local\MSAL.PS\MSAL.PS.msalcache.bin3'
PS>TerminatingError(Get-MsalToken): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: One or more errors occurred."
PS>TerminatingError(Get-MsalToken): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to get user name. "
>> TerminatingError(Get-MsalToken): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to get user name. "
PS>TerminatingError(Get-MsalToken): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: One or more errors occurred."
PS>TerminatingError(Get-MsalToken): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: No account or login hint was passed to the AcquireTokenSilent call. "
>> TerminatingError(Get-MsalToken): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: No account or login hint was passed to the AcquireTokenSilent call. "
Get-Process : Cannot find a process with the process identifier 18968.
At C:\WINDOWS\TEMP\5a091755-3c8f-4429-be51-4deeb910b2db\msal.ps\Get-MsalToken.ps1:262 char:42
+ ... ParentWindow = (Get-Process -Id $Win32Process.ParentProcessId).MainWi ...
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (18968:Int32) [Get-Process], ProcessCommandException
    + FullyQualifiedErrorId : NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand
Get-Process : Cannot find a process with the process identifier 18968.
At C:\WINDOWS\TEMP\5a091755-3c8f-4429-be51-4deeb910b2db\msal.ps\Get-MsalToken.ps1:262 char:42
+ ... ParentWindow = (Get-Process -Id $Win32Process.ParentProcessId).MainWi ...
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (18968:Int32) [Get-Process], ProcessCommandException
    + FullyQualifiedErrorId : NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand

PS>TerminatingError(Get-MsalToken): "The property 'MainWindowHandle' cannot be found on this object. Verify that the property exists."
      Problem connecting to Microsoft Graph. Exit.
You cannot call a method on a null-valued expression.
At C:\drivers\desktops\Set-OutlookSignatures\Set-OutlookSignatures.ps1:3272 char:13
+             $script:authorizationHeader = @{
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

I have attached a verbose output from one of the computers:
SetSig.txt

Search method Group Onpremise

Hello,
First of all, I thank you for your work on this signature, the functions are great and will be very useful to me.
Is there a limitation in the membership of AD Onpremise groups? I have tried all the possible syntaxes, I always have an error "Not found, please check" in the Group specific template section.
Knowing that a simple TokemGroups search script returns the membership of my user

Thanks in advance for your help.

Getting MSAL token not working on Windows Server 2016

Hello Markus,

we have deployed your script in organisation and it works fine on Windows 10/11 computers running Outlook. However, the organisation has RDSH terminal server running Windows Server 2016 and script is not working on the server. It throws error: Get-MsalToken : An error occurred while sending the request. I have checked and tried all troubleshooting hints given in error message but issue remains. Furthermore, I did script run on other servers running Windows Server 2016 and it throws same error. I have tried script on Windows Server 2019 machines and it worked fine just like on Windows 10/11 machines.

Best Regards

Haris Alatovic

HTML template variables replacement not working

Hi,
I am testing the last version of set-outlooksignature in order to migrate from the 3.6.
I have hopes that the signatures in outlook web are working since the new version of outlook is full web.
We are using only the html templates and generating only signatures.
When I try to use our own template for the signature, the variables inside are not replaced, even when testing with the "Test all default replacement variables.htm" delivered with the .zip.
Is the a specific way to configure the html templates now?
Thanks for your help.

Error when executing the script

Hi,
I have an issue when executing the script on client computer. There is an issue at the line 1039 when converting the user SID to a string...
or system.byte[]... It seems the sid has an invalid format... even if it looks good.
It works on my computer and my windows user that is just a domain user.
Is there a minimal powershell version to run this script?
Thanks

Missing State/Province

I just noticed that you are missing state in the GraphUserAttributeMapping and also in the default replacement variables.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.