{"id":18031,"date":"2010-06-17T00:01:00","date_gmt":"2010-06-17T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/06\/17\/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2\/"},"modified":"2010-06-17T00:01:00","modified_gmt":"2010-06-17T00:01:00","slug":"hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2\/","title":{"rendered":"Hey, Scripting Guy! How Can I Sign Windows PowerShell Scripts with an Enterprise Windows PKI? (Part 2 of 2)"},"content":{"rendered":"<p><a href=\"http:\/\/www.addthis.com\/bookmark.php?v=250&amp;pub=scriptingguys\"><br \/><img decoding=\"async\" height=\"16\" width=\"125\" src=\"http:\/\/s7.addthis.com\/static\/btn\/v2\/lg-share-en.gif\" alt=\"Bookmark and Share\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\" \/><\/p>\n<p>Hey Scripting Guy! Will you give us the final steps in the step-by-step guide about how to use an existing Windows PKI installation to sign Windows PowerShell scripts, or were you just kidding <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2010\/06\/16\/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-1-of-2.aspx\">yesterday<\/a>? <\/p>\n<p>&#8211;HR <\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Hello HR, <\/p>\n<p>Microsoft Scripting Guy Ed Wilson here. Just as we promised yesterday, we continue today with the final steps involved in Windows PKI to sign scripts. We go back to Ragnar Harper.<\/p>\n<p>&nbsp;<\/p>\n<p><b><span style=\"font-size: medium\">Step 3: Sign my Windows PowerShell script and run it<\/span><\/b><\/p>\n<p>In this step we will be inside Windows PowerShell, and we will sign our script. For this purpose I have a simple script named demoscript.ps1.<\/p>\n<p><span style=\"background-color: #f5f5f5\">$yourName=Read-Host &#8220;What is your name?&#8221;<\/span><\/p>\n<p><span style=\"background-color: #f5f5f5\">Write-Host &#8220;Hello $yourName&#8221;<\/span><\/p>\n<p>Just a quick reminder that your requirements for signed scripts are set using the <b>Set-ExecutionPolicy<\/b> cmdlet (or by Group Policy).<\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n<tbody>\n<tr>\n<td width=\"201\" valign=\"top\">\n<p><b>Setting<\/b><\/p>\n<\/td>\n<td width=\"389\" valign=\"top\">\n<p><b>Description<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"201\" valign=\"top\">\n<p>Unrestricted<\/p>\n<\/td>\n<td width=\"389\" valign=\"top\">\n<p>No requirements; all scripts allowed<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"201\" valign=\"top\">\n<p>RemoteSigned<\/p>\n<\/td>\n<td width=\"389\" valign=\"top\">\n<p>All local scripts allowed; only signed remote scripts<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"201\" valign=\"top\">\n<p>AllSigned<\/p>\n<\/td>\n<td width=\"389\" valign=\"top\">\n<p>All scripts need to be signed<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"201\" valign=\"top\">\n<p>Restricted<\/p>\n<\/td>\n<td width=\"389\" valign=\"top\">\n<p>No scripts allowed<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For this demonstration, my <b>executionpolicy<\/b> is set to <b>AllSigned<\/b>. If I just try to run my script, it will fail, as shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-01.jpg\"><img decoding=\"async\" height=\"72\" width=\"654\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6761.hsg61710011_4812E7A1.jpg\" alt=\"Image of failed script message\" border=\"0\" title=\"Image of failed script message\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>We will use the cmdlet <b>Set-AuthenticodeSignature<\/b> to sign the script. I will start storing the code signing certificate in a variable named <b>$cert<\/b>.<\/p>\n<p><span style=\"background-color: #f5f5f5\">$cert=(dir cert:currentuser\\my\\ -CodeSigningCert)<\/span><\/p>\n<p>Then I am ready to sign my script with the <b>Set-AuthenticodeSignature<\/b> cmdlet. This is shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-02.jpg\"><img decoding=\"async\" height=\"119\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8420.hsg61710021_14D6AE38.jpg\" alt=\"Image of signing script with Set-AuthenticodeSignature cmdlet\" border=\"0\" title=\"Image of signing script with Set-AuthenticodeSignature cmdlet\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>As you see, the status is valid, so the signing was successfully done. Please note that I recommend that you supply the <b>TimeStampServer<\/b> parameter. This will make sure the script works even though the certificate that signed it is expired. It will tell the system that the code signing certificate was valid at the time of signing. (Okay, I can imagine there are some situations where this might not be correct, but I also guess it will be good enough for most of us.) If you do not use the <b>TimeStampServer<\/b> parameter, the script will stop to work when the certificate used for signing expires. There are multiple sources for timestamping out there. Use one that suits you.<\/p>\n<p>Let us try to run the scripts again, and see what happens. The results are shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-03.jpg\"><img decoding=\"async\" height=\"74\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0871.hsg61710031_34858800.jpg\" alt=\"Image of results of running script again\" border=\"0\" title=\"Image of results of running script again\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>We get a question if we want to run the script or not. The question says that this is a script from an untrusted publisher. In Step 4, I will show you how to make the publisher (code signing certificate) trusted for your domain.<\/p>\n<p>As for this computer, you can now make this publisher trusted by choosing <b>A<\/b> for <b>Always run<\/b>. If you choose <b>V<\/b> for <b>Never run<\/b>, you will explicitly make this publisher untrusted, and scripts signed by this certificate will not run. <\/p>\n<p>Let&rsquo;s stop and see what exactly is happening here. If you make any choice persistent (such as <b>Always run<\/b> or <b>Never run<\/b>), the code signing certificate is stored as a trusted or untrusted publisher on your computer. You can see this through the GUI if you open mmc.exe and load the Certificates snap-in, as shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-04.jpg\"><img decoding=\"async\" height=\"244\" width=\"196\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8726.hsg61710041_0D4B3ECB.jpg\" alt=\"Image of trusted and untrusted publisher nodes\" border=\"0\" title=\"Image of trusted and untrusted publisher nodes\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Or, you could also do this from Windows PowerShell: <\/p>\n<p><span style=\"background-color: #f5f5f5\">dir cert:\\CurrentUser\\TrustedPublisher<\/span><\/p>\n<p><span style=\"background-color: #f5f5f5\">dir cert:\\CurrentUser\\Disallowed<\/span><\/p>\n<p>As you will see in Step 4, you can also control this setting through Group Policy. For now, you can just click <b>Run Once<\/b>, and the script is allowed to execute. If you open the script, you will see that the signature is attached at the bottom.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-05.jpg\"><img decoding=\"async\" height=\"288\" width=\"254\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8814.hsg61710051_5AE76B4B.jpg\" alt=\"Image of signature at bottom of script\" border=\"0\" title=\"Image of signature at bottom of script\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>You can also use validate the signature using the <b>Get-Authenticode<\/b> cmdlet.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-06.jpg\"><img decoding=\"async\" height=\"311\" width=\"520\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3630.hsg61710061_13921559.jpg\" alt=\"Image of validating signature with Get-Authenticode cmdlet\" border=\"0\" title=\"Image of validating signature with Get-Authenticode cmdlet\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>In this step, I showed you how to sign a Windows PowerShell script, and also how to make it trusted or untrusted on your computer. In the next step, we will make the code signing certificate trusted in our domain using group policy.<\/p>\n<p><b><span style=\"font-size: medium\">Step 4: Make the code signing certificate trusted in my domain<\/span><\/b><\/p>\n<p>If you were to deploy this in your domain, you would probably use Group Policy to make sure the code signing certificate in use is a trusted publisher. To do this there a two steps:<\/p>\n<p>1. Export the code signing certificate.<\/p>\n<p>2. Create a policy and import the code signing certificate into trusted publishers.<\/p>\n<h5><span style=\"font-size: small\">Export the code signing certificate<\/span><\/h5>\n<p>Let&rsquo;s start with exporting the code signing certificate from the client computer where we requested the certificate.<\/p>\n<p>Start the Certificates snap-in as shown in Step 2 <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2010\/06\/16\/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-1-of-2.aspx\">yesterday<\/a>. Open the <strong>Personal<\/strong> node, and then <strong>Certificates<\/strong>. In the content pane, you will now see your certificate. (The one with <b>Intended Purpose<\/b> set to <b>Code Signing<\/b>). Right-click the certificate, click <b>All Tasks<\/b>, and then click <b>Export<\/b>. You can see this in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-07.jpg\"><img decoding=\"async\" height=\"172\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3443.hsg61710071_612E41D9.jpg\" alt=\"Image of steps for exporting code signing certificate\" border=\"0\" title=\"Image of steps for exporting code signing certificate\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Click <b>Next<\/b> in each of the three dialog boxes you see. Make sure that you save the certificate somewhere you can access it from the computer on which you are going to run Group Policy Management. There is no security risk making the public part of this certificate available, so you can store it wherever you want. <\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-11.jpg\"><img decoding=\"async\" height=\"278\" width=\"304\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2860.hsg61710111_00DD1BA2.jpg\" alt=\"Image of Certificate Export Wizard\" border=\"0\" title=\"Image of Certificate Export Wizard\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>This finishes the export part from the client. Now we need to open up the Group Policy Management Console. This is a part of the Server Administration tools and is usually found if you have installed RSAT (Remote Server Administration Tools) on your client or on your domain controller. For this demonstration, I will run this from one of my domain controllers.<\/p>\n<h5><span style=\"font-size: small\">Create a policy and import the code signing certificate into trusted publishers<\/span><\/h5>\n<p>When I open the Group Policy Management Console, I start by creating a new policy. I open my domain (<b>harper.labs<\/b>), right-click it, and click <b>Choose Create a GPO in this domain, and link it here<\/b>.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-13.jpg\"><img decoding=\"async\" height=\"316\" width=\"272\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3124.hsg61710131_40A70227.jpg\" alt=\"Image of creating GPO\" border=\"0\" title=\"Image of creating GPO\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Make sure that you create this Group Policy object (GPO) where you want it in your own domain. For this demonstration, I create it at the domain level. I give the policy the name <b>Certificates Policy<\/b>, and I click <b>OK<\/b>. <\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-14.jpg\"><img decoding=\"async\" height=\"115\" width=\"244\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7331.hsg61710141_124D7C7A.jpg\" alt=\"Image of creating new GPO\" border=\"0\" title=\"Image of creating new GPO\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Select the policy (<b>Certificates Policy<\/b>) in the navigation pane, right-click it, and click <b>Edit<\/b>, as shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-15.jpg\"><img decoding=\"async\" height=\"245\" width=\"248\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6170.hsg61710151_31FC5642.jpg\" alt=\"Image of starting editing certificate process\" border=\"0\" title=\"Image of starting editing certificate process\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Wait for the Group Policy Editor to start, and then click <b>Computer Configuration<\/b>, click<b> Policies<\/b>, click<b> Windows Settings<\/b>, and then click<b> Public Key Policies<\/b>. You are now ready to start the import. Right-click <b>Trusted Publishers<\/b>, and then click <b>Import<\/b>.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-16.jpg\"><img decoding=\"async\" height=\"387\" width=\"398\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1057.hsg61710161_2A70E6D5.jpg\" alt=\"Image of starting certificate import\" border=\"0\" title=\"Image of starting certificate import\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>In the dialog box that asks you for the certificate to import, select the certificate you exported earlier. Then click <b>Next<\/b>. <\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-17.jpg\"><img decoding=\"async\" height=\"224\" width=\"248\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7331.hsg61710171_09E9A723.jpg\" alt=\"Image of selecting certificate to import\" border=\"0\" title=\"Image of selecting certificate to import\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>As shown in the following image, make sure the certificate is placed in the Trusted Publishers store, and click <b>Next<\/b>.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-18.jpg\"><img decoding=\"async\" height=\"224\" width=\"248\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7824.hsg61710181_109CB0A6.jpg\" alt=\"Image of placing certificate in Trusted Publishers store\" border=\"0\" title=\"Image of placing certificate in Trusted Publishers store\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Now finish the wizard by clicking <b>Finish<\/b>. You have imported the certificate as a trusted publisher, which is shown in the following image. <\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-19.jpg\"><img decoding=\"async\" height=\"223\" width=\"248\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4113.hsg61710191_174FBA29.jpg\" alt=\"Image of finishing Certificate Import Wizard\" border=\"0\" title=\"Image of finishing Certificate Import Wizard\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>You can confirm this by looking inside the Trusted Publishers node in the Group Policy Editor as shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-20.jpg\"><img decoding=\"async\" height=\"352\" width=\"557\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6747.hsg61710201_1E02C3AC.jpg\" alt=\"Image of certificate in Trusted Publishers node\" border=\"0\" title=\"Image of certificate in Trusted Publishers node\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>So, the next time the policy is updated on computers in your domain, they will add this certificate as a trusted publisher. You can now run scripts signed by this certificate without being asked if the certificate is trusted or not. You can also do the same with untrusted certificates if you want.<\/p>\n<p>I will test this from my client computer. I will first make sure that the certificate is not in my trusted publishers list. This should be done through the Certificates snap-in on my client. <\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-21.jpg\"><img decoding=\"async\" height=\"244\" width=\"396\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2134.hsg61710211_1677543F.jpg\" alt=\"Image of ensuring certificate isn't already in trusted publishers list\" border=\"0\" title=\"Image of ensuring certificate isn't already in trusted publishers list\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>Then I run <b>gpupdate \/force<\/b> from my Windows PowerShell window. The results are shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-22.jpg\"><img decoding=\"async\" height=\"131\" width=\"390\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6170.hsg61710221_681DCE91.jpg\" alt=\"Image of results of running gpudate \/force in Windows PowerShell\" border=\"0\" title=\"Image of results of running gpudate \/force in Windows PowerShell\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>When the update is finished successfully, I refresh the Trusted Publishers list in my Certificates snap-in. My certificate should now be listed as trusted, as shown in the following image.<\/p>\n<p><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/june\/hey0617\/hsg-6-17-10-23.jpg\"><img decoding=\"async\" height=\"201\" width=\"434\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1057.hsg61710231_67B19B9C.jpg\" alt=\"Image of certificate being trusted\" border=\"0\" title=\"Image of certificate being trusted\" style=\"border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px\" \/> <\/a><\/p>\n<p>I hope this helps, and have fun with Windows PowerShell!<\/p>\n<p>&nbsp;<\/p>\n<p>HR, that is all there is to using Windows PKI to sign Windows PowerShell scripts. This brings Guest Blogger Week to a close. Check with us tomorrow as we delve into the virtual mail bag for Quick-Hits Friday. <\/p>\n<p>If you want to know exactly what we will be looking at tomorrow, follow us on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send e-mail to us at <a href=\"mailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>, or post them on the <a href=\"http:\/\/bit.ly\/scriptingforum\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b><br \/>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/b><\/p>\n<p><strong><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Hey Scripting Guy! Will you give us the final steps in the step-by-step guide about how to use an existing Windows PKI installation to sign Windows PowerShell scripts, or were you just kidding yesterday? &#8211;HR &nbsp; &nbsp; Hello HR, Microsoft Scripting Guy Ed Wilson here. Just as we promised yesterday, we continue today with [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[56,150,151,3,63,45],"class_list":["post-18031","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-guest-blogger","tag-ragnar-harper","tag-script-signing","tag-scripting-guy","tag-security","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; Hey Scripting Guy! Will you give us the final steps in the step-by-step guide about how to use an existing Windows PKI installation to sign Windows PowerShell scripts, or were you just kidding yesterday? &#8211;HR &nbsp; &nbsp; Hello HR, Microsoft Scripting Guy Ed Wilson here. Just as we promised yesterday, we continue today with [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/18031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=18031"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/18031\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=18031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=18031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=18031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}