[GH-ISSUE #59] Error when executing the script #21

Closed
opened 2026-02-27 20:30:50 +03:00 by kerem · 11 comments
Owner

Originally created by @AnotherFranck on GitHub (Nov 22, 2022).
Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/59

Originally assigned to: @GruberMarkus, @AnotherFranck on GitHub.

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

Originally created by @AnotherFranck on GitHub (Nov 22, 2022). Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/59 Originally assigned to: @GruberMarkus, @AnotherFranck on GitHub. 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
kerem 2026-02-27 20:30:50 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@GruberMarkus commented on GitHub (Nov 22, 2022):

Hi @AnotherFranck,

line 1039 does not directly deal with SID conversion. Are you using the latest version?

For further analysis, please reproduce the problem with running Set-OutlookSignatures with the -verbose parameter, and then post the log file here.

Windows Powershell 5.1 is the minimum version Set-OutlookSignatures is tested with.

<!-- gh-comment-id:1323568219 --> @GruberMarkus commented on GitHub (Nov 22, 2022): Hi @AnotherFranck, line 1039 does not directly deal with SID conversion. Are you using the latest version? For further analysis, please reproduce the problem with running Set-OutlookSignatures with the -verbose parameter, and then post the log file here. Windows Powershell 5.1 is the minimum version Set-OutlookSignatures is tested with.
Author
Owner

@AnotherFranck commented on GitHub (Nov 22, 2022):

Hi @GruberMarkus,

Here is the exception log (in french! sorry), the error is the same even with the verbose option :(

Unexpected error. Exit.
New-Object : Impossible de convertir l'argument «0» (valeur «S-1-5-21-3197280838-653142112-32783236-11130») de «SecurityIdentifier» en type «
System.Byte[]»: «Impossible de convertir la valeur «S-1-5-21-3197280838-653142112-32783236-11130» en type «System.Byte[]». Erreur: «Impossible de
convertir la valeur «S-1-5-21-3197280838-653142112-32783236-11130» en type «System.Byte». Erreur: «Le format de la chaîne d'entrée est incorrect.»»»
Au caractère \server\Data\ITTOOLS\Set-OutlookSignatures\Set-OutlookSignatures.ps1:1039 : 34

  • ... serSIDs += (New-Object System.Security.Principal.SecurityIdentifier $ ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation : (:) [New-Object], MethodException
    • FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

I hope this will help.

Thanks

<!-- gh-comment-id:1323746914 --> @AnotherFranck commented on GitHub (Nov 22, 2022): Hi @GruberMarkus, Here is the exception log (in french! sorry), the error is the same even with the verbose option :( Unexpected error. Exit. New-Object : Impossible de convertir l'argument «0» (valeur «S-1-5-21-3197280838-653142112-32783236-11130») de «SecurityIdentifier» en type « System.Byte[]»: «Impossible de convertir la valeur «S-1-5-21-3197280838-653142112-32783236-11130» en type «System.Byte[]». Erreur: «Impossible de convertir la valeur «S-1-5-21-3197280838-653142112-32783236-11130» en type «System.Byte». Erreur: «Le format de la chaîne d'entrée est incorrect.»»» Au caractère \\server\Data\ITTOOLS\Set-OutlookSignatures\Set-OutlookSignatures.ps1:1039 : 34 + ... serSIDs += (New-Object System.Security.Principal.SecurityIdentifier $ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation : (:) [New-Object], MethodException + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand I hope this will help. Thanks
Author
Owner

@GruberMarkus commented on GitHub (Nov 22, 2022):

Please post the complete log file.

Please also check if you are using the most recent version of Set-OutlookSignatures. You very likely use an older version, as line 1039 is not related to any SID operation in the most recent version.

<!-- gh-comment-id:1323768024 --> @GruberMarkus commented on GitHub (Nov 22, 2022): Please post the complete log file. Please also check if you are using the most recent version of Set-OutlookSignatures. You very likely use an older version, as line 1039 is not related to any SID operation in the most recent version.
Author
Owner

@AnotherFranck commented on GitHub (Nov 22, 2022):

Hi @GruberMarkus
Let me try with the new version. I was using the 3.3.0. I have to test with a user now. I'll keep you updated.
Thanks

<!-- gh-comment-id:1323857458 --> @AnotherFranck commented on GitHub (Nov 22, 2022): Hi @GruberMarkus Let me try with the new version. I was using the 3.3.0. I have to test with a user now. I'll keep you updated. Thanks
Author
Owner

@AnotherFranck commented on GitHub (Nov 23, 2022):

Hi @GruberMarkus
I finally have the same issue.

script.log

Maybe it is related to the user account. I don't know since it is working for my own account.

I have this issue for a user on windows 10 and other one with windows 11.

We are only using the script to create the signature with html template.

Thanks

Regards

<!-- gh-comment-id:1324770777 --> @AnotherFranck commented on GitHub (Nov 23, 2022): Hi @GruberMarkus I finally have the same issue. [script.log](https://github.com/GruberMarkus/Set-OutlookSignatures/files/10074124/script.log) Maybe it is related to the user account. I don't know since it is working for my own account. I have this issue for a user on windows 10 and other one with windows 11. We are only using the script to create the signature with html template. Thanks Regards
Author
Owner

@GruberMarkus commented on GitHub (Nov 23, 2022):

Do I see correctly that you run the script on a client has connection to your local Active Directory?

Do I see correctly that the user is located in your local Active Directory, but the user's mailbox is hosted in Exchange Online?

<!-- gh-comment-id:1324825122 --> @GruberMarkus commented on GitHub (Nov 23, 2022): Do I see correctly that you run the script on a client has connection to your local Active Directory? Do I see correctly that the user is located in your local Active Directory, but the user's mailbox is hosted in Exchange Online?
Author
Owner

@AnotherFranck commented on GitHub (Nov 23, 2022):

The user in connected to the lan and has a direct connection to the AD.
The user is located in the local Active Directory and the mailbox is hosted on Office 365.

<!-- gh-comment-id:1324844417 --> @AnotherFranck commented on GitHub (Nov 23, 2022): The user in connected to the lan and has a direct connection to the AD. The user is located in the local Active Directory and the mailbox is hosted on Office 365.
Author
Owner

@GruberMarkus commented on GitHub (Nov 23, 2022):

Please test again with the attached development version.

Use the '-verbose' parameter and post the complete script output.

Set-OutlookSignatures.ps1.txt

Delete the old Set-OutlookSignatures.ps1 file, download the file linked above and save it as new Set-OutlookSignatures.ps1.

<!-- gh-comment-id:1324856270 --> @GruberMarkus commented on GitHub (Nov 23, 2022): Please test again with the attached development version. Use the '-verbose' parameter and post the complete script output. [Set-OutlookSignatures.ps1.txt](https://github.com/GruberMarkus/Set-OutlookSignatures/files/10074689/Set-OutlookSignatures.ps1.txt) Delete the old Set-OutlookSignatures.ps1 file, download the file linked above and save it as new Set-OutlookSignatures.ps1.
Author
Owner

@AnotherFranck commented on GitHub (Nov 23, 2022):

Hi @GruberMarkus
I ask the user to execute the script and it seems to work better, I need to check if the signature has been copied but from the log it does... I just have an error due to the fact I have no OOF template. We just need a signature in Outlook application.
scriptnobody.log
The signature is generated, I have checked with the user.
I will test a bit further.
Thanks

<!-- gh-comment-id:1325132097 --> @AnotherFranck commented on GitHub (Nov 23, 2022): Hi @GruberMarkus I ask the user to execute the script and it seems to work better, I need to check if the signature has been copied but from the log it does... I just have an error due to the fact I have no OOF template. We just need a signature in Outlook application. [scriptnobody.log](https://github.com/GruberMarkus/Set-OutlookSignatures/files/10076265/scriptnobody.log) The signature is generated, I have checked with the user. I will test a bit further. Thanks
Author
Owner

@GruberMarkus commented on GitHub (Nov 23, 2022):

The root cause for opening this issue has been found and the problem solved. I will therefore close this issue. A new version will be released within the next days.

Thanks for reporting and testing!

If you do not want to set OOF messages, configure the SetCurrentUserOOFMessage parameter (see Readme for details).

If you do not want to signatures to be set in Outlook Web, configure the SetCurrentUserOutlookWebSignature parameter (see Readme for details).

Your tenant seems to have signature roaming enabled, which causes an error. Have a look at the corresponding FAQ in Readme and consider disabling the feature in your tenant or setting DisableRoamingSignaturesTemporaryToggle in your Outlook registry configuration.

<!-- gh-comment-id:1325177720 --> @GruberMarkus commented on GitHub (Nov 23, 2022): The root cause for opening this issue has been found and the problem solved. I will therefore close this issue. A new version will be released within the next days. Thanks for reporting and testing! If you do not want to set OOF messages, configure the SetCurrentUserOOFMessage parameter (see Readme for details). If you do not want to signatures to be set in Outlook Web, configure the SetCurrentUserOutlookWebSignature parameter (see Readme for details). Your tenant seems to have signature roaming enabled, which causes an error. Have a look at the corresponding FAQ in Readme and consider disabling the feature in your tenant or setting DisableRoamingSignaturesTemporaryToggle in your Outlook registry configuration.
Author
Owner

@AnotherFranck commented on GitHub (Nov 23, 2022):

Hi @GruberMarkus
I'll wait the new version :) I'll check the readme for the the options you mentioned.
Thanks for your time, your communication and your work. I appreciated it!

<!-- gh-comment-id:1325204454 --> @AnotherFranck commented on GitHub (Nov 23, 2022): Hi @GruberMarkus I'll wait the new version :) I'll check the readme for the the options you mentioned. Thanks for your time, your communication and your work. I appreciated it!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Set-OutlookSignatures-Set-OutlookSignatures#21
No description provided.