Signed Powershell Script

Hello,

I have trouble with self signed Powershell scripts.

I've created a CodeSign Certificate from the internal CA in my Domain.

After that I've used this Certificate to sign PS scripts.

When I call these scripts in a running shell I get this message:

Do you want to run software from this untrusted publisher?
File z:\Applications\Scripts\HelloWorld.ps1 is published by CN=Administrator, CN=Users, DC=contoso, DC=com
and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help (default is "D")

I've imported this certificate to the Trusted Root Store of the Server and the current User Account.

So I can't explain why this is not working!

Has anyone a hint for me?

Thanks!

March 26th, 2015 7:23am

Hi AbuNael,

After you trust the file, the script can be run. The first time you run the script, if it's digitally signed but the publisher isn't trusted, you will be prompted to add the publisher among the trusted publishers, and you can choose the "Always run" option, the code signing certificate will be added to the "Trusted Publishers" in your certificate store, and you will no longer be prompted the next time you execute a script signed with that certificate.

Refer to:

How to Sign a PowerShell script 

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang

Free Windows Admin Tool Kit Click here and download it now
March 27th, 2015 2:54am

Hi AbuNael,

The first time you run the script, you will be prompted to add the publisher among the trusted publishers, and you can choose the "Always run" option, the code signing certificate will be added to the "Trusted Publishers" in your certificate store, and you will no longer be prompted the next time you execute a script signed with that certificate.

Refer to:

How to Sign a PowerShell script 

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang

March 27th, 2015 2:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics