Uptime of system on network

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report, they are all in a Active Directory domain... needs to
be in C# or VB.NET preferably. thanks!
 
Brian,

You could just have a service running on the server which will take note
when it starts. Then, to get the uptime, you can call to the service, and
take the difference between the current time and the time that the system
went up.

You could use remoting to access this information as well.

Hope this helps.
 
Brian said:
does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report
[...snip...]

You might check the System EventLog for the youngest event like #6009 (forr
boot up). This can be done with a pure .net solution.
 
Another possibility is Environment.TickCount. This returns the Number of
milliseconds since the last system bootup. When the System runs for more
than 24.9 Days (or 49.7 days, when you are pInvoking GetTickCount), the tick
count will wrap around, though.
 
Brian Henry said:
does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report, they are all in a Active Directory domain... needs
to be in C# or VB.NET preferably. thanks!

You could use System.Management classes to query the servers WMI class
"Win32_Operatingsystem" "Lastboottime" property.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Maximum Recommended Uptime 8
system uptime proggie 8
XP Uptime Quickie :) 12
Uptime Meters - lost remote connection 2
Windows uptime 4
Pulling more text? 7
Windows Server What can Active Directory Do? 6
CPU Time 2

Back
Top