Solved

VB Script to verify computer is on-line

Posted on 2009-07-14
6
406 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now