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! 4 2771
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Brian Henry" <no****@nospam. com> wrote in message
news:OW******** *****@tk2msftng p13.phx.gbl... 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 Henry wrote: 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.Tic kCount. 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" <no****@nospam. com> wrote in message
news:OW******** *****@tk2msftng p13.phx.gbl... 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.Manageme nt classes to query the servers WMI class
"Win32_Operatin gsystem" "Lastbootti me" property.
Willy. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Oli Schwarz |
last post by:
Hello,
how can I read out the uptime of a unix system in python (Linux and *BSD).
I have not found a uptime-function in the Library.
Regards
Oli
|
by: Esmail Bonakdarian |
last post by:
Hi,
Is there a way to display how long a Win XP system has been up?
Somewhat analogous to the *nix uptime command.
Thanks,
Esmail
|
by: Brian Henry |
last post by:
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!
|
by: Dylan Parry |
last post by:
Hi,
I'm looking for a way to calculate the amount of time that Windows has
been running since the last boot. Ideally I'd like to be able to create
a DateTime object containing this value so that I can format it however
I like.
I've so far found a program called "uptime.exe" which is supplied by
Microsoft on their website, but it outputs the uptime value as a string
in the format "\\FRED has been up for: 5 day(s), 1 hour(s), 30
|
by: streamkid |
last post by:
hello..
could anyone please help me build a uptime script for openbsd?
i tried phpsysinfo, it doesn't work (only uptime works, and that's
around 15k days :p)
i tried these:
<?php
$uptime_output = system("uptime", $uptime_output);
print $uptime_output;
?>
| |
by: Guy Macon |
last post by:
How to increase web server uptime with DNS failover:
For illustration, let's start with some really bad hosting...
Find four free web hosts that are each 90% reliable
-- in other words they each are down on average one
day out of ten. Use a failover DNS system with monitoring
to switch servers if one fails. On average:
One server will be down one day out of ten
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |