We are in the process of upgrading from BF 9.5 to 10.* and I was very happy to see the addition of the powershell dropdown in creating tasks. I am currently trying to setup a task to essentially add a networked printer using the basic ADD-PRINTER command, but when it fails when running. As I am still fairly new to powershell in Bigfix, if anyone has any advice it would be greatly appreciated. I get an exit code of -1 when it fails, and I will post the command string below.
Add-Printer -ConnectionName \Server name\printer name
That’s an interesting case…since this is connecting to a network server it will need to run in User context rather than System context. I don’t think our built-in PowerShell action type can do that, as the ‘override’ commands are all native action script.
I think you’ll need to do this the “old way”, using the native Action Script type, where you build the PowerShell script and save it to a file, use the ‘override’ options to run in User context, and execute PowerShell.exe to run your script.
Thanks for the information, I’ll definitely give it a shot!