Hey Guys...Im trying to take some sample vbscript for the MFCOM (MetaFrame COM) object and turn them into kix. Any assistance would be appreciated. Im having trouble on the initialization portion for some reason. Its probably just some syntax thing on my end.
Here is one of the VBScript samples...
Code:
<package>
<job id="LUsers">
<comment>
File: LUsers.wsf
Description: List user count per each server in the farm.
Requirements: WSH 5.5 or higher.
Copyright (c) 2002 Citrix Systems, Inc.
</comment>
<runtime>
<description>
List user count per each server in the farm.
</description>
<example>
CScript //nologo LUsers.wsf
</example>
</runtime>
<reference object="MetaFrameCOM.MetaFrameFarm"/>
<script language="VBScript">
Dim theFarm, aServer, aSession, Count, SessionList
Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
'
' Initialize the farm object.
'
theFarm.Initialize(MetaFrameWinFarmObject)
For Each aServer In theFarm.Servers
Set SessionList = aServer.Sessions
For Each aSession In SessionList
Count = SessionList.Count
Exit For
Next
Count = Count - 5
WScript.Echo aServer.ServerName & ", " & Count
Next
WScript.Echo "Press ENTER to exit..."
WScript.StdIn.Read(1)
</script>
</job>
</package>
And here is a short script I am trying to write to get the users IP address...
Code:
$ctxfarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
If @Error <> 0
? "Error occurred while creating the farm object"
? ""+@Error+" - "+@SError
Endif
$ctxfarm.Initialize(MetaFrameWinFarmObject)
If @Error <> 0
? "Error occurred while initializing the farm object"
? ""+@Error+" - "+@SError
Endif
For Each $ctxserver in $ctxfarm.servers
If $ctxserver = @WkSta
For Each $ctxsession in $ctxserver.sessions
If $ctxsession.UserName = @UserID
? "You Are....."
? "Client Name : "+$Session.ClientName
? "Client Addr : "+$Session.ClientAddress
Endif
Next
Endif
Next
get $
I keep getting a Type Mismatch error when I try to do the .initialize. Any ideas?