/build/static/layout/Breadcrumb_cap_w.png

Can a powershell script output information to KACE when run from the Scripting module

Usually, when we run PS scripts using the scripting module, the only output we gety in the output logs is a status message saying that the PS script was successfully launched. Unfortunately, this does not let us know if the script itself ran without issue.

Is there anyway to have a script send back an exit code or status massage to the output logs so that I can tell if the script itself encountered issues?

Any help would be greatly appreciated.


0 Comments   [ + ] Show comments

Answers (5)

Posted by: KHaught 9 years ago
Senior Yellow Belt
0

You could have the script write a txt file on each PC which you could then pull into inventory in a custom inventory rule.

Posted by: SMal.tmcc 9 years ago
Red Belt
0

What does the script do. You can create custom rules to look for a certain change, whether it is a reistry key creation or modification, or a dir or file creation or time stamp change.  I usually set that same change as a validator for the script so it does not run over and over again on a machine.

Posted by: ndelo 9 years ago
Yellow Belt
0

We use PS and KACE a lot of roll out software, make configuration changes to files, etc. etc.

What I was hoping was that I could throw unexpected exceptions back to the output log during the script run so that when something failed to get the change or software I'd have an idea of why without having to log into machines locally and run the script to see what condition caused it to fail.

I already know how to tell is a change was successful, but I was hoping I could get information saying why it failed, which is more than knowing that it failed.

I can grab exceptions with a try/catch block but I wanted to pass the exception information back up the stack to KACE at the end of the run.

Posted by: ncsutmf 9 years ago
Green Belt
0

If you had a specific error code, you could specify it with an exit statement, for example if you just wanted to exit with an error code of 1 you would use:

exit 1

This is assuming the K1000 will pay attention to that error code and log it when it runs the script.  I have not tested this so I can't answer that part.

You could also, as was already mentioned, write to a log file.  You should be able upload the log as the last step in the script, so you wouldn't need a custom inventory for it.

Posted by: ndelo 9 years ago
Yellow Belt
0

I guess that's exactly what I am asking, will KACE record the exit codes from a script run via the agent.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ