Thanks Ron! That worked great. _____ From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf Of Ron Oglesby Sent: Thursday, December 18, 2003 1:11 PM To: thin@xxxxxxxxxxxxx Subject: [THIN] Re: Script help What samples do you have? Got this one? '*************************************************************************** * ' '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. >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 > 1 Then svrName = objArgs(0) savePath = objArgs(1) Set fso = CreateObject("Scripting.FileSystemObject") Set fp = fso.CreateTextFile(savePath & svrName & ".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 <ServerName> <FileSavePath>" End If Ron Oglesby Senior Technical Architect RapidApp Office 312.372.7188 Mobile 815.325.7618 email roglesby@xxxxxxxxxxxx <mailto:roglesby@xxxxxxxxxxxx> -----Original Message----- From: Phillips, Kevin [mailto:KPhillips@xxxxxxxxxxxxxxxxxxxxx] Sent: Thursday, December 18, 2003 11:49 AM To: thin@xxxxxxxxxxxxx Subject: [THIN] Script help I'm just trying to create a script that will un-publish all apps from a server. I found some examples, but I always get an error "invalid procedure call" on the line of code "aApp.Initialize MetaframeWinAppObject,appDN" Any help would be appreciated. Thanks! **************************************************************************** ***************************************************************** 'On Error Resume Next Dim Farm, unserver, appDN Set Farm=CreateObject("MetaframeCOM.MetaframeFarm") farm.Initialize 1 Const MetafameWinAppObject=3 Wscript.Echo "Farm name is " & farm.Farmname unserver = inputbox("What server do you want to unpublish?") For Each mfserver in Farm.servers If mfserver.servername=unserver Then Set aApps=mfserver.applications For Each app in aApps app_name=app.appname appDN=app.distinguishedname Set aApp=CreateObject("MetaframeCom.MetaframeApplication") aApp.Initialize MetaframeWinAppObject,appDN aApp.LoadData(TRUE) wscript.sleep(500) aApp.RemoveServer unserver aApp.savedata() Set aApp = nothing Next End If Next **************************************************************************** ********************************************************* Kevin Phillips Web Services Administrator Creative Solutions Kphillips@xxxxxxxxxxxxxxxxxxxxx <mailto:Kphillips@xxxxxxxxxxxxxxxxxxxxx>