Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking if a remote node has self-rebooted.

Status
Not open for further replies.

JTan

Technical User
Oct 9, 2001
73
SG
This is a question not pointing directly to Win 2k.

I just like to find out if there is any command in Windows that allows to find out if a remote node is alive/self-rebooted mins earlier.

There is such a commmand known as rup in Solaris. And I am wondering if this command can be used in MSDOS as well.
 
I'll second that PsInfo is a very handy util and there are many more great utils on that site.
 
Although it won't tell you if a server was rebooted, UPTIME.EXE avail in the Windows NT/2000 Reskit (think was added by default in 2003), will tell you how long a Windows host has been up.
 
Psinfo will tell you system uptime. But as you say typing 'systeminfo' at the command prompt on 2k3/XP will tell you this.
 
I use vbscript to notify me if a server has rebooted.
Code:
'==========================================================================
'
' VBScript Source File -- 
'
' NAME: NotifyReboot.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]	
' DATE  : 02/13/2003
'
' COMMENT: 
'
' This script can be added to a machines startup script in Group Policy to notify
' an e-mail address that the machine has restarted.
'
' You must customize the entries for oDomain, oMyIP and oTo with the proper company information.
' Items to customize are on lines 29, 31 and 33.
'=====================================
 
Dim oName, ODomain, oMyIP, oTo

' Get the computer name
Set WshNetwork = CreateObject("WScript.Network")
oName = WshNetwork.ComputerName

' Set the company specific information

' Company Internet Domain Name
ODomain = "yourdomain.com"
' Set the SMTP server IP
oMyIP = "192.168.1.1" 
' Where do you want the message to be delivered
oTo = "admin@youraddress.com"


' Set the visual basic constants as they do not exist within VBScript.
' Do not set your smtp server information here.
Const cdoSendUsingMethod = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing",[/URL] _
cdoSendUsingPort = 2, _
cdoSMTPServer = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver"[/URL]

' Create the CDO connections.
Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

' SMTP server configuration.
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort

' Set the SMTP server address here.
.Item(cdoSMTPServer) = oMyIP
.Update
End With

' Set the message properties.
With iMsg
Set .Configuration = iConf
.To = oTo
.From = oName & "@" & oDomain
.Subject = "Server Reboot"
.TextBody = "Server " & oName & " at company " & ODomain & " was restarted " & now
End With

' An attachment can be included.
'iMsg.AddAttachment Attachment

'Send the message.
iMsg.Send 

MsgBox "Done"

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top