I'm using psshutdown on our teaching PCs to shut them down after 10pm but would like to log the results of the batch file as some aren't working, I think due to some odd security settings from a while back.
Tried piping the cmd batch file output to a text file but it only shows the commands psshutdown runs e.g. shutting down PC06 but no output e.g. shutdown successful
Anyone got a logging system set up?
Not sure that you'll be able to do this - I think that all psshutdown does is to tell the computer to shut down and, provided that the PC accepts this, then you get "OK" back. If it fails to shutdown (eg box pops up saying "Save your work?" then psshutdown will know nothing about it.
What you could do is wait (say) 5 minutes and then try and ping the machines you tried to shut down; if they reply then your shutdown failed.
When you say "odd security settings", do you know what or is this one of those things you've inherited?? I know you can prevent an interactive shutdown and you can prevent remote RPC connections but I can't think of anything else!
From digging through the policies it seems the previous admin has restricted "access this computer over the network" and a few others through User Rights Assignment on the Computer GPO. Other machines were making out that they weren't contactable (as in psshutdown could't get a response) yet when I ran the script one by one they shut down OK - script runs with admin rights so shouldn't have a problem there. It's currently set as a scheduled task.
Gonna reset those policies back to Not Defined when I build up a new policy for the Teaching Machines, to go with the new shiny mandatory profiles I'm using rather than HDGuard (similar to Deepfreeze) and setting each machine's user settings manually (:confused::rolleyes:)
No more AntiVirus update problems and ability to use SMS software distribution without worrying HDGuard's there ready to wipe it on reboot :cool:
How about a scheduled task about 30 mins later:
net view > pcslefton.txt
combine this with bmail to email the log to yourself.