Rick
Thu Sep 18 14:20:22 CDT 2003
Open and read the file. One line, check the status, output to file, then
read the next.
Calls functions for IsValidPing, GetUser for current logged in user,
CheckService, the CheckRPCVersion. That code not included.
==============================
Set WshFS = WScript.CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set File = WshFS.GetFile("H:\RemoteScripts\AllSystems.csv")
Set TextStream = File.OpenAsTextStream(ForReading)
Counter = 0
Set OutputFile =
WshFS.CreateTextFile("H:\RemoteScripts\AllSystemsHealth.csv", 1)
Do While Not TextStream.AtEndOfStream
CurrentLine = TextStream.ReadLine
System2update = Left(UCase(CurrentLine), InStr(CurrentLine,",") -1)
wscript.echo "Starting the trigger for " & System2Update
If IsValidPing(System2Update) Then
WScript.Echo System2Update & " is alive and well!"
Status = "Alive"
CurrentUser = "," & GetUser(System2Update)
NAVServiceStatus = "," & CheckService(System2Update)
RPCVersion = "," & CheckRPCVersion(System2Update)
Else
WScript.Echo System2Update & " cannot be contacted."
Status = "Not responding"
CurrentUser = ""
RPCVersion = ""
NAVServiceStatus = ""
End If
OutputFile.WriteLine CurrentLine & "," & Status & CurrentUser &
NAVServiceStatus & RPCVersion
Loop
TextStream.Close
OutputFile.Close
"Moley" <moley_cruz@yahoo.com.au> wrote in message
news:%23q8FrOefDHA.1732@TK2MSFTNGP12.phx.gbl...
> how do i amend the script to take in 100 computer names from a .txt file?
>
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
> news:3F69A472.4628EAE@hydro.com...
> > Moley wrote:
> >
> > > I have a list of 100 computer hostnames. How can i know whether they
are
> > > currently on the network using scripting?
> >
> > Hi
> >
> > The VBScript function IsConnectible in the link below will work on all
OS
> > versions (it uses ping.exe to ping the host to see if it is online):
> >
> >
http://groups.google.com/groups?selm=3EB2AA54.EBB5ECBC%40hydro.com
> >
> >
> > --
> > torgeir
> > Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > Administration scripting examples and an ONLINE version of the 1328 page
> > Scripting Guide:
http://www.microsoft.com/technet/scriptcenter
> >
> >
>
>