Hallo,
i have the following problem, i have a Windows TS 2003 with 3 Clients. On
startup the 3 clients autoconnect to the TS2003. But the problem is, when
all 4 machines start at the same time, the 3 Clients start faster than the
TS, the get an errormessage, when the try to connect to the TS.
So i tried to write a script, which waits if the TermService is startet
(Status=4), and afterwars connects to the Server.
But the problem is, if the TS is down, the Script can't create the Object
"objComputer" and it jumps in the IF (see below).
Is there a way to ask if the Object "objComputer" is created correctly?
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
strComputername="server1"
strServiceName="TermService"
strProgram="mstsc.exe"
'
********************************************************************************************
Do
Set objComputer = GetObject("WinNT://" & strComputername)
Set objService = objComputer.GetObject("Service",strServiceName)
If objService.status = 4 Then
Set objProgram = CreateObject("WScript.Shell")
objProgram.Run strProgram
Exit Do
End If
Loop
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
thanks for help
mfg martin