/build/static/layout/Breadcrumb_cap_w.png

System Shutdown / Restart Report for a particular machine - K1000

Is there a way to run a report on shutdown and restart on a particular pc?


2 Comments   [ + ] Show comments
  • Are you wanting to know when the last time it shutdown, or every time it has shutdown? - dugullett 11 years ago
  • everytime... thank you - binuani 11 years ago

Answers (1)

Posted by: dugullett 11 years ago
Red Belt
1

Since Kace doesn't get every restart by default you might want to try a custom inventory rule. After the machine has checked in you can then turn it into a report.

ShellCommandTextReturn(powershell.exe "get-eventlog system|WHERE-OBJECT{$_.EventID -eq 1074}|sort-object timewritten|format-list timewritten,message")

Comments:
  • this would work perfect.. thank you very much!!
    It is working on 2003 server, w7 and 2012 server not on windows 2008 r2 servers any idea why it is ? - binuani 11 years ago
    • I would check to make sure you can run that powershell command locally on server 08. I don't have one off hand to test on. Make sure the event ID 1074 is the same on 08. - dugullett 11 years ago
  • not sure why its not running... i can run it manually on the server and it works; i was able to get the output to a text file

    get-eventlog system|WHERE-OBJECT{$_.EventID -eq 1074}|sort-object timewritten|format-list timewritten,message >>c:\restartlog.txt - binuani 11 years ago
    • You can create a custom inventory to read that .txt file. Would it be possible for you to set up a scheduled task to run on your servers? Either that or from a KScript?

      ShellCommandTextReturn(cmd.exe /c type C:\restartlog.txt)

      You might even be able to use your current one that works on other OSs, and use an OR (not tested).

      ShellCommandTextReturn(powershell.exe "get-eventlog system|WHERE-OBJECT{$_.EventID -eq 1074}|sort-object timewritten|format-list timewritten,message") OR ShellCommandTextReturn(cmd.exe /c type C:\restartlog.txt) - dugullett 11 years ago
 
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