Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to check login's to apps

Status
Not open for further replies.

krammer

IS-IT--Management
Jul 15, 2007
59
US
Does anyone know of a script, or would know how to make one to check the logging in of applications in citrix? We do daily checks every morning to make sure we can log into certain apps...so I wanted to see if there was a way to automate this. Let me know, thanks. We use Citrix Metaframe Presentation server for Windows v4.0.3
 
I found this script in the Script Repository on the citrix website, but I don't know how I would tweak this to do what I want...


Code:
Set objIco = CreateObject("Citrix.ICAClient")

'Set Browser Protocol
objIco.BrowserProtocol = "UDP"

'Set Server locator
objIco.TCPBrowserAddress = "192.168.16.78"

'Disable IPCLaunch
objIco.IPCLaunch = FALSE

'Set to launch, rather than embed session
objIco.Launch = TRUE

'Enable seamless
objIco.TWIMode = TRUE

'objIco.XmlAddressResolutionType = "IPv4-Port"
objIco.ConnectionEntry = "Notepad"
objIco.WinstationDriver = "ICA 3.0"
objIco.TransportDriver = "TCP/IP"

'Set credentials
objIco.Username = "tuser"
objIco.SetProp "Password","citrix"
'objIco.Domain = "iforum1"

'Specify application to launch
objIco.Application = "Notepad"

'Connect!!
objIco.Connect()
 
I researched a little more and found some other parts of the script that might be usefull:

Code:
Dim objICO, fso, strApp

Set objICO = WScript.CreateObject("Citrix.ICAClient")
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("C:\Results.txt") Then
  Set ofile = fso.OpenTextfile("C:\Results.txt", 8)
Else
  Set ofile = fso.CreateTextFile("C:\Results.txt", true)
End If

strApp = "VCI"
  Call Test("server1")
strApp = Nothing

strApp = "Mas200"
  Call Test("server2")
strApp = Nothing

Sub Test(Server)
	'Set Browser Protocol
	objICO.BrowserProtocol = "UDP"

	'Set Server locator
	objICO.TCPBrowserAddress = Server

	'Disable IPCLaunch
	objICO.IPCLaunch = FALSE

	'Set to launch, rather than embed session
	objICO.Launch = TRUE

	'Enable seamless
	objICO.TWIMode = TRUE

	objICO.ConnectionEntry = "Notepad"
	objICO.WinstationDriver = "ICA 4.0"
	objICO.TransportDriver = "TCP/IP"

	'Set credentials
	objICO.Username = "test"
	objICO.SetProp "Password","citrix"
	objICO.Domain = "domain"

	'Specify application to launch
	objICO.Application = strApp

	'Connect!!
	objICO.Connect()
  WScript.Sleep 1000
  n = 1
  c = 0
  d = 0
  Do While n < 21
   If objICO.IsConnected = "True" Then
    c = 1
   End If
   If c = 1 Then
    objICO.Disconnect
    WScript.Sleep 1000
   End If
   If objICO.IsConnected = "False" And C = 1 Then
    ofile.writeline Server & " " & "Test Succeeded" & " " & Date & " " & Time
    d = 1
    n = 21
   End If
   WScript.Sleep 1000
   n = n+1
  Loop
  If c = 0 Then
   ofile.writeline Server & " " & "Test Failed: Connection Attempt Timed Out" & " " & Date & " " & Time
  End If
  If c = 1 And d = 0 Then
   ofile.writeline Server & " " & "Test Failed: Disconnect Attempt Failed" & " " & Date & " " & Time
  End If
End Sub
Wscript.Echo "Test Complete!  Results in C:\Results.txt"
WScript.Quit

Can anyone help with this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top