Friday, July 13, 2007

MFCOM: Farm Session Count

Another day of Citrix Administration, a simple MFCOM script to view Active Farm Sessions.

Code Snippet:

  1. Const cMetaFrameWinFarmObject = 1
  2. Const MFSessionStateActive = 1
  3. Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
  4. theFarm.Initialize(cMetaFrameWinFarmObject)
  5. intSessionCount = 0
  6. intActiveCount = 0
  7. For Each oSession In theFarm.Sessions
  8. intSessionCount = intSessionCount + 1
  9. If (oSession.SessionState = MFSessionStateActive) and (oSession.SessionName <> "Console") Then
  10. intActiveCount = intActiveCount + 1
  11. WScript.Echo vbcrlf & "*****************************"
  12. WScript.Echo "User Name: " & oSession.UserName
  13. WScript.Echo "IP Address: " & oSession.ClientAddress
  14. WScript.Echo "Server: " & oSession.ServerName
  15. WScript.Echo "Application: " & oSession.AppName
  16. WScript.Echo "Logon Time: " & oSession.ConnectedTime
  17. End If
  18. Next
  19. WScript.Echo "Total Session Count = " & intSessionCount & vbcrlf & _
  20. "Active Session Count = " & intActiveCount


If at first you fail, call it version 1.0

MFCOM: Connection licenses and usage count

Yet Another Citrix Administrator Task, monitor the connection licenses and usage count in the farm...

Feel like a hill billy...

Code Snippet:

  1. Dim fso
  2. Set fso = CreateObject("Scripting.FileSystemObject")
  3. If not fso.FolderExists("c:\liclog" ) then
  4. Set MyFolder = fso.createFolder("c:\liclog" )
  5. else
  6. End if
  7. if not fso.FileExists("c:\liclog\licCount.log" ) then
  8. Set MyFile= fso.createTextFile("c:\liclog\licCount.log")
  9. MyFile.writeline "Date " & " Time " & "Lic Type " & "Used"
  10. MyFile.close
  11. else
  12. end if
  13. Const ForAppending = 8
  14. Set MyFile= fso.OpenTextFile("c:\liclog\licCount.log", ForAppending,True)
  15. Dim theFarm, aLicense
  16. Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
  17. ' Initialize the farm object.
  18. theFarm.Initialize(MetaFrameWinFarmObject)
  19. For Each aLicense In theFarm.LicenseSets(MFLIcenseClassConnection)
  20. if aLicense.LicenseID = "0000000000000003" then
  21. MyFile.WriteLine date & "," & time & "," & aLicense.Name &amp;amp; "," & aLicense.pooledinuse("")
  22. else
  23. end if
  24. next
  25. MyFile.Close


If at first you fail, call it version 1.0

Monday, July 09, 2007

Merlin the great!

Imagine how amazed your users will be when they login to the domain and Merlin greets them...

You can call Merlin using Agent Control and make do the moves while you perform you login scripts in the background...

You can load information about the logged on user either using ADSI scripts or just by reading on the environment variable table...

Take note of the length of the messages or actions you throw at Merlin, you might need to make use of the Sleep method, otherwise the sentences or the animation will overlap...

Code Snippet:


  1. strAgentName = "Merlin"
  2. strAgentPath = "Msagent\Chars\" & strAgentName &amp;amp; ".acs"
  3. Set objAgent = CreateObject("Agent.Control.2")
  4. objAgent.Connected = True
  5. objAgent.Characters.Load strAgentName, strAgentPath
  6. Set merlin_d_great = objAgent.Characters.Character(strAgentName)
  7. With merlin_d_great
  8. .Show
  9. Set objRequest = .MoveTo(500,400)
  10. Set objRequest = .Play("Announce")
  11. Set objRequest = .Play("Explain")
  12. Set objRequest = .Speak("Hi ")
  13. Set objRequest = .Play("Read")
  14. wscript.sleep 2000
  15. Set objRequest = .Speak("Today is " & Now() & "...")
  16. Set objRequest = .Play("ReadContinued")
  17. wscript.sleep 2000
  18. Set objRequest = .Speak("and the time is " &amp; Time() & "...")
  19. wscript.sleep 2000
  20. Set objRequest = .Play("ReadReturn")
  21. wscript.sleep 2000
  22. Set objRequest = .MoveTo(750, 450)
  23. Set objRequest = .Play("Pleased")
  24. wscript.sleep 5000
  25. Set objRequest = .Speak("I will be back shortly...")
  26. wscript.sleep 5000
  27. Set objRequest = .Play("Wave")
  28. wscript.sleep 5000
  29. .Hide
  30. End With

Have a blast with Merlin, and oh... you can use other characters aswell...

If at first you fail, call it version 1.0

Radia Command Lines

There are few documents available on Radia troubleshooting and knowledgebase so I decided to post

Q. What is Radia?
A. Radia is Software Deployment\Management Solution (formerly Novadigm EDM\Radia) that was bought by HP.

Q. What is RCS?
A.

Q. What is RPM?
A.

Q. What is RPX\RPS?
A.

Q. What is RMS?
A.



  1. nvdkit objdump
  2. nvdkit.exe objdump zconfig.edm | FIND /I
  3. nvdkit eval nvd::init; set radexe "[exec $::NVDSYS/RADNTFYC.EXE RADCONCT.EXE mode=discovery]"
  4. nvdkit tpping -host
  5. nvdkit sync

  6. If at first you fail, call it version 1.0

    KD Memory.dmp debugging

    One of our Citrix server encountered a BSOD, luckily we had RSA and managed to hard reboot the server.

    I've gathered the memory dump to view the cause of BSOD and found the Symantec Antivirus has caused a module error on the NIC driver.

    We have then disabled the Network Drives in the File System Auto Protect and it had not experienced the same ever since.

    Did not find any help from Symantec regarding the root cause other than it's a known issue.

    Below are some steps that you could use for debbuging:

    1. Launch windbg passing it the location of the symbol files, the source files (i386 directory) and the dump file. Example: windbg -y dump\symbols -i SRC\i386 -z dump\Memory.dmp

    2. At the bottom of the Command window there is a kd> prompt.

    3. The commands are entered into that prompt: kd>!analyze -v

    4. Two things to look for in the results: the memory referenced and the FAULTING_IP

    5. The command: kd>lm - will produce a listing of modules and their memory location.

    6. Look to see which module's memory the memory referenced identified above falls in.

    7. That usually indicates the process that caused the crashed and will probably match the FAULTING_IP if listed.

    8. Also informative: kd>.reload –v

    If at first you fail, call it version 1.0