Solved

VB Script to verify computer is on-line

Posted on 2009-07-14
6
408 Views
Last Modified: 2012-05-07
I need a VB Script to verify a group of computers in active directory are on-line each night.  When they are off-line 3 consecutive nights, then I need to be either given a report or notified.  The script could even save the report to a server share if need be.  The script does not have to query active directory.  If I need to, then I could supply a text file with all of the computer names.
0
Comment
Question by:bbanis2k
  • 4
  • 2
6 Comments
 
LVL 25

Expert Comment

by:SStory
ID: 24850261
You could PING the machine:

if Ping(strHost) = True then
    'responded
    'in here you could log it somehow
else
    'in here you could log it somehow
end if

However, firewalls and hibernation/, etc could cause problems with this.


0
 

Author Comment

by:bbanis2k
ID: 24850504
Does not seem like a good option.
0
 
LVL 25

Expert Comment

by:SStory
ID: 24858669
OK. What do you mean by online or offline? Reachable by the network?  If so pinging is a good test.
If you want to step up to VB.NET, you could do something similar to ping, or you could connect to a share via UNC paths and if you cannot consider the machine offline.  Firewalls and hibernation could still cause it to fail.  If it is a machine that should always be on, then hibernation and "sleeping" should be turned off and the firewalls adjusted to allow you to do whatever check you need to.

Are these machines in house and on the same network?

There is another more technical way of doing it. you could have a vb.net client program run on each of the machines that you want to watch and a special version running on the monitor.  Have the controller broadcast a message over the subnet broadcast (UDP), saying "Who's out there" and see who responds and keep a log. This would require a lot more code. There are examples on the internet.
Of course Windows does that all of the time to see who is out there.

As for an AD way to do it, I don't know how, but someone else may.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:bbanis2k
ID: 24860085
Same network...I just want to avoid ICMP traffic, due to firewall rules in Windows.

0
 
LVL 25

Accepted Solution

by:
SStory earned 500 total points
ID: 24861196
yes, I understand

OK. you could try to do something with WMI:

Here is a link to someone doing it remotely.
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_23213918.html

0
 
LVL 25

Expert Comment

by:SStory
ID: 24861208
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Batch file or script with password 22 44
create an aggregate function 9 36
MS SQL + Insert Into Table - If Doesnt Exist 9 35
Query to capture 5 and 9 digit zip code? 4 21
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question