// Run the PowerShell script as the specified user
wait runas /user={parameter “user”} /password={parameter “password”} powershell.exe -ExecutionPolicy Bypass -File “{parameter “scriptPath”}” “{paramter “commVault”}”
the action fails as shown below from log file. so where is the problem in the script
Not sure what OS you’re running, but I’ve never encountered ‘/password’ as an allowed parameter on the ‘runas’ command. It’s not supported on my Win11 or Win2022.
was not expecting it to run just saw example on google search. The other was expected to complete. Is there a way to add debug without using the 1000 option as it writes out lots of redundant info of no importance to this type of issue. i just don’t know what is wrong based on code. His there a tool can show me what the action is running to see why it exits
Well the first thing to try is just to find a command that works on the plain-old command line. Open a command prompt and try the command you’re executing -
That already won’t work because runas.exe does not accept a ‘password=’ parameter. Runas does not provide a way to supply the password on the command line, as far as I know. And also I think you misspelled ‘commvault’.
Next, once you have figured out the right command line that does what you want it to do, without prompting for any user info, you should test it in an environment similar to what BigFix is using. That means running the command as the LocalSystem account. Download psexec from www.microsoft.com/sysinternals , and use the command psexec -i -s cmd.exe to launch an interactive command prompt running as LocalSystem. Check that your command line works in that environment too.
Finally, you’ll want BigFix to execute your command in the native/64-bit mode. By default when we launch commands we run them in 32-bit mode, for backward compatibility, but that’s almost never what you want with new content. add the line action uses wow64 redirection false to your actionscript, anywhere before the ‘wait’ command.