PowerShell | Be What's Automated .. ™

Manoj Nair's technical blog covering topics such as PowerShell,Exchange Server,Virtualization, Windows Server and related Microsoft Technologies

VBScript to find out last reboot time of multiple computers

VBScript to find out last reboot time of multiple computers

  • Comments 4
  • Likes

I usually write quite a lot of scripts to automate tasks that would otherwise consume my whole day. I am a big fan of Microsoft PowerShell but occasionally do write a few scripts in VBScript. I uploaded one such script on the Technet Script Center. This VBScript uses the Win32_OperatingSystem WMI class to output the last reboot time of a computer specified in a text file.

The script can be viewed at the ScriptCenter Repository at the link below:

Last Reboot Timestamp


  • Could you please guide me , How can i check this script in my environment?

  • Hey Mey,

    Save the script as a .vbs file(for example, demo.vbs). Now, put all your computer names in a text file, one on each line in a text file (Lets take what's been referenced in the script C:\Scripts\Servers.txt)

    Now, just execute the script by double clicking on it or by opening a command prompt and executing the following command cscript C:\Scripts\demo.vbs (assuming that you have placed the demo.vbs file in the Scripts Directory on your C drive.That's all about it.

    P.S: Note that you need to administrative access on all the computers listed in the text file so that script can query the WMI class.


    Manoj R. Nair

  • Manoj,

    I tried your script againt my servers but the Reports came back with the same hours for ALL my servers.  985406 hours

    Any ideas?

  • Reports came back with the same hours

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment