<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article How to use hash authentication for PowerShell Scripts with AAM Credential Provider in Secrets Management Articles</title>
    <link>https://live.paloaltonetworks.com/t5/secrets-management-articles/how-to-use-hash-authentication-for-powershell-scripts-with-aam/ta-p/1427525</link>
    <description>&lt;P&gt;If you are using CyberArk&amp;nbsp;hash authentication against a PowerShell script retrieving a credential with a AAM Credential provider, you will have to force PowerShell to run the shell and the code in the same process and not spawn a child process. If PowerShell runs a child process, it causes the following error:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;APPAP309E Script run using untrusted shell.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;/UL&gt;
&lt;H3&gt;Steps&lt;/H3&gt;
&lt;P&gt;You are able force PowerShell to run the shell and the code in the same process and not spawn a child process&amp;nbsp; by running the following PowerShell command to execute the “Test-Script.ps1” script whose Hash we retrieved and placed in the application’s authentication restrictions in the PVWA:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /File C:\Users\Administrator\Desktop\PS_Scripts\Test-Script.ps1&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;When you run the “Test-Script.ps1” with the HASH authentication using the command above, you will be&amp;nbsp;able to run the script successfully and retrieve your&amp;nbsp;password within the script.&lt;BR /&gt;&lt;BR /&gt;You can also test modifying the script to ensure Idira is validating the script’s hash before running. Idira will check the current Hash of “Test-Script.ps1” with the Hash we specified for&amp;nbsp;the application on the PVWA. So when you try to run the modified script whose hash has changed, you should receive an error similar to the one below:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;APPAP133E Failed to verify application authentication data: Hash "74F6873CB917DB795C077F4D20450A21DEC230855BE6C6740F9F736D960EA78673633EC2D3CB7B12000D9146ADFB8823A98328A41846C370FB302E591B57A692" is unauthorized&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;If you plan to provide PowerShell scripts to your team whose embedded credential have&amp;nbsp;been replaced with a password retrieval with the Idira AAM Credential Provider, you may consider creating the following scripts:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Execute-Script.ps1&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;UL style="list-style-type: circle;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /File C:\Users\Administrator\Desktop\PS_Scripts\Test-Script.ps1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Test-Script.ps1&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;UL style="list-style-type: circle;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Invoke-Expression "&amp;amp; 'C:\Program Files (x86)\CyberArk\ApplicationPasswordSdk\clipasswordsdk.exe' getpassword /p appdescs.appid='PowerShell Scripts' /p query='Safe=AIM Test Safe;Object=AIMTestUser01' /o password"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Calibri&amp;quot;,sans-serif;"&gt;The scripts above show a workflow that in order to run the hashed script "Test-Script.ps1"&amp;nbsp;they will run the “Execute-Script.ps1” so they don’t have to remember to syntax to run the PowerShell shell and code in the same process.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2026 20:10:38 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2026-11-05T20:10:38Z</dc:date>
    <item>
      <title>How to use hash authentication for PowerShell Scripts with AAM Credential Provider</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management-articles/how-to-use-hash-authentication-for-powershell-scripts-with-aam/ta-p/1427525</link>
      <description>&lt;P&gt;If you are using CyberArk&amp;nbsp;hash authentication against a PowerShell script retrieving a credential with a AAM Credential provider, you will have to force PowerShell to run the shell and the code in the same process and not spawn a child process. If PowerShell runs a child process, it causes the following error:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;APPAP309E Script run using untrusted shell.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;/UL&gt;
&lt;H3&gt;Steps&lt;/H3&gt;
&lt;P&gt;You are able force PowerShell to run the shell and the code in the same process and not spawn a child process&amp;nbsp; by running the following PowerShell command to execute the “Test-Script.ps1” script whose Hash we retrieved and placed in the application’s authentication restrictions in the PVWA:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /File C:\Users\Administrator\Desktop\PS_Scripts\Test-Script.ps1&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;When you run the “Test-Script.ps1” with the HASH authentication using the command above, you will be&amp;nbsp;able to run the script successfully and retrieve your&amp;nbsp;password within the script.&lt;BR /&gt;&lt;BR /&gt;You can also test modifying the script to ensure Idira is validating the script’s hash before running. Idira will check the current Hash of “Test-Script.ps1” with the Hash we specified for&amp;nbsp;the application on the PVWA. So when you try to run the modified script whose hash has changed, you should receive an error similar to the one below:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;APPAP133E Failed to verify application authentication data: Hash "74F6873CB917DB795C077F4D20450A21DEC230855BE6C6740F9F736D960EA78673633EC2D3CB7B12000D9146ADFB8823A98328A41846C370FB302E591B57A692" is unauthorized&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;If you plan to provide PowerShell scripts to your team whose embedded credential have&amp;nbsp;been replaced with a password retrieval with the Idira AAM Credential Provider, you may consider creating the following scripts:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Execute-Script.ps1&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;UL style="list-style-type: circle;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /File C:\Users\Administrator\Desktop\PS_Scripts\Test-Script.ps1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Test-Script.ps1&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;UL style="list-style-type: circle;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11pt;"&gt;&lt;SPAN style="font-family: Calibri,sans-serif;"&gt;Invoke-Expression "&amp;amp; 'C:\Program Files (x86)\CyberArk\ApplicationPasswordSdk\clipasswordsdk.exe' getpassword /p appdescs.appid='PowerShell Scripts' /p query='Safe=AIM Test Safe;Object=AIMTestUser01' /o password"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: &amp;quot;Calibri&amp;quot;,sans-serif;"&gt;The scripts above show a workflow that in order to run the hashed script "Test-Script.ps1"&amp;nbsp;they will run the “Execute-Script.ps1” so they don’t have to remember to syntax to run the PowerShell shell and code in the same process.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2026 20:10:38 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management-articles/how-to-use-hash-authentication-for-powershell-scripts-with-aam/ta-p/1427525</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2026-11-05T20:10:38Z</dc:date>
    </item>
  </channel>
</rss>

