Finding uptime of network PCs (XP)

Kelemvor

Lifer
May 23, 2002
16,928
8
81
Howdy,

Is there any faster way than using the Systeminfo command to get the uptime of an XP PC remotely? We have a bunch of specialized systems that are supposed to reboot every day but we find that some don't and I'm trying to find a way I can check them all from my own PC via a batch file.

Right now I'm just using systeminf /s PCNAME but it takes almost 15 seconds each which means 8 hours to check all 2300 of the ones I need to check.

Just wondering if there's a more trimmed down way to just get the uptime and not everything else like systeminfo does.

Thanks.
 

power_hour

Senior member
Oct 16, 2010
779
1
0
Howdy,

Is there any faster way than using the Systeminfo command to get the uptime of an XP PC remotely? We have a bunch of specialized systems that are supposed to reboot every day but we find that some don't and I'm trying to find a way I can check them all from my own PC via a batch file.

Right now I'm just using systeminf /s PCNAME but it takes almost 15 seconds each which means 8 hours to check all 2300 of the ones I need to check.

Just wondering if there's a more trimmed down way to just get the uptime and not everything else like systeminfo does.

Thanks.

Get the Uptime utility from Sysinternals (Microsoft). Very easy to script in a batch file. Its free to use.
 

Paperlantern

Platinum Member
Apr 26, 2003
2,239
6
81
I am currently in the process of building a powershell script that pulls machine names from out of an OU in active directory (it can also be a predefined array), puts them in an array, checks the uptime of teach machine in the array in turn and if it is larger than 36 hours, it issues a reboot command. It isnt done yet but i should have it finished sometime monday as long as things don't blow up on me and take my time away from writing the script.

Powershell is an incredible tool to automate processes and I love it.

I wrote a script yesterday to automate a process on a server where form time to time a file folder gets clogged with temp files and I was having to clean it out almost every couple of days. The process takes about 5 minutes manually consisting of stopping 3 different services, moving several hundred files from the temp location to a holding folder out of the programs working directory (in case you need them for anything), deleting a file, renaming another file to a *.old file to make the service build a new one once the three services are started again. It got annoying enough for me to make the script. The script stops each service in turn, tests to make sure each service stopped, performs the file operations, tests to make sure they completed successfully, restarts the services, tests to be sure they are all running and then sends me a success e mail if all went off as it should, or a failed e mail if any process failed along the way.

The script executes in 30 seconds.

I love powershell.

You can do _anything_ with it.
 
Last edited:

Paperlantern

Platinum Member
Apr 26, 2003
2,239
6
81
Ive completed the script portion of just being able to ping the computer and see if it is there. it is extremely fast, we dont have 2000 computers but we do have about 400, and the script is done in about 15 seconds. Sample output of this particular script is as follows:

COMPNAME01 Success
COMPNAME02 Success
COMPNAME03 Success
COMPNAME04 Success
COMPNAME05 DestinationNetworkUnreachable
COMPNAME06 Success
COMPNAME07 Success
COMPNAME08 Success
COMPNAME09 TimedOut
COMPNAME10 Success
COMPNAME11 Success
COMPNAME12 Success

You get the idea...

This will be the case for every machine in the array the loop hits on. The only real delays in the process are when a computer doesnt respond, it takes a moment to move to the next one. Let me know if you would like to see the code for it or not, i'll try to get it to a generic state where you should be able to recognize where you can plug in your own values fairly easily.
 
Last edited: