Powershell action script for credentail manager not working

I am able to execute the powershell but it is not clearing up the windows credentials from bigfix action script but same script is able to clear that when i run it locally

// Enter your action script here

// Disable wow64 redirection on x64 OSes
action uses wow64 redirection {not x64 of operating system}

waithidden { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File “c:\temp\cred.ps1”

cred.ps1

cmdkey /list | ForEach-Object{if($_ -like “Target:” -and $_ -like “microsoft”){cmdkey /del:($_ -replace " “,”" -replace “Target:”,"")}}

Keep in mind if you run it from a local instance of the FixletDebugger, you are running in your logged in user context. Running from a Bigfix fixlet, it will run in SYSTEM context so will only have access to credentials stored as the SYSTEM account.

The action failed.

Action Script Execution Detail
Completed // Enter your action script here
Completed // Disable wow64 redirection on x64 OSes
Completed action uses wow64 redirection {not x64 of operating system}
**Completed override wait **
**Completed completion=job **
**Completed hidden=false **
Completed runas=currentuser
Failed

wait { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File “c:\temp\cred.ps1”

Was there a user logged on to the machine? If I recall correctly, “RunAs=currentuser” only works when a user is logged on to the machine - and I think it may require a local console login, not just a Remote Desktop session.

The client log from the machine may show more details.

override wait command is failing

Yes user is logged in with my id :slight_smile:

Ok need snippet from client log then.

Somehow it started working for me , just replaced powershell to bat file and overrite syntax issue resovled.

1 Like