Citrix 1.x - Upgrade to MPS 4 - SVROFFLINE.VBS no longer works

Guest On a Server that was recently upgraded to MPS 4 a script that removes all Published applications no longer works. The error is — svroffline(40,13) MS VBScript Runtime Error: Invalid Procedure Call or Argument

The script still works fine on a server that runs MF XPa FR3

The script is

****************************************************************************

’svrOffline.vbs

‘Description: Take a MF XP server “offline” by unpublishing all applications
‘ published from the server. The published app names are stored
‘ to a text file in a path specified in the command line so that
‘ the server can be brought back ‘online” by the svrOnline script.

‘Usage: Two required command line parameters - 1) MF XP server name (case
‘ sensitive 2) file path (with trailing “\” character)

‘ e.g. %26gt;cscript svrOffline.vbs MFXPTS05 C:\WINNT\TEMP\

‘****************************************************************************

Dim fso
Dim fp
Dim svrName
Dim savePath
Dim mfSvr
Dim mfApp
Dim objArgs

Set objArgs = WScript.Arguments
If objArgs.Count %26gt; 1 Then

svrName = objArgs(0)
savePath = objArgs(1)

Set fso = CreateObject(”Scripting.FileSystemObject”)

Set fp = fso.CreateTextFile(savePath %26#38; svrName %26#38; “.txt”, True, False)

Set mfSvr = CreateObject(”MetaFrameCOM.MetaFrameServer”)
mfSvr.Initialize 6, svrName

For Each mfApp In mfSvr.Applications
mfApp.RemoveServer svrName
mfApp.SaveData
fp.WriteLine mfApp.DistinguishedName
Next

fp.Close

Else
MsgBox “Usage: svrOffline.vbs %26lt;ServerName%26gt; %26lt;FileSavePath%26gt;”
End If

Any help is appreciated


James Wambold I have seen this error occationally with this script. Here are a few things to try.

1. unregister and reregister mfcom with the mfreg.exe program. mfreg /u mfreg #servername#

2. Reboot the server. Sometime the server has an unknown error and rebooting fixes it allowing the script to work correctly.

Category: Citrix 1.x