- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
If you are using CyberArk 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:
You are able force PowerShell to run the shell and the code in the same process and not spawn a child process 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:
When you run the “Test-Script.ps1” with the HASH authentication using the command above, you will be able to run the script successfully and retrieve your password within the script.
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 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:
If you plan to provide PowerShell scripts to your team whose embedded credential have been replaced with a password retrieval with the Idira AAM Credential Provider, you may consider creating the following scripts:
The scripts above show a workflow that in order to run the hashed script "Test-Script.ps1" 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.