**DONOTDELETE**
(Lurker)
2000-04-25 08:33 AM
Find All Workstations in Domain

I was wondering if anyone know how to do the following, if it is possible with KIX:

I would like to run a script on my local workstaion (I am a domain admin) to find the name and OS of all workstations in the domain and write this info to an .INI file. All of the workstations start with "MON"
and are followed by four digits (ex. MON1234). I know how to get the script to scroll through the names OK, but I don't understand how to check for the existence of a machine and/or it's OS (all are Windows based).

Any help is greatly appreciated. Thanks in advance!

John Garrett
Tek Systems



ShawnAdministrator
(KiX Supporter)
2000-04-25 09:47 AM
Re: Find All Workstations in Domain

John...

This is the way I check to see if a machine is alive and well before I do some sort of remote operation.

Ping is a heck of alot quicker then having to wait for some remote access command or program to time-out on it's own.

code:

$host="your_hostname_here"


shell '%comspec% /c ping -n 1 $host | find "Reply" >nul'
if @error = 0
?"Host $host is alive"
else
?"Host $host is dead or just wants to be alone right now!"
endif


Do a serch on this board for "OS Version" and you should find examples of how to determine OS through the registry.

Shawn.



**DONOTDELETE**
(Lurker)
2000-04-25 10:32 AM
Re: Find All Workstations in Domain

Beautiful! That helps tremendously! Thanks for your help Shawn!

John