[THIN] Re: Script help

  • From: mach1-70@xxxxxxxxx
  • To: thin@xxxxxxxxxxxxx
  • Date: Thu, 18 Dec 2003 18:27:22 +0000

Ron...That is very useful.....Do you have the source for the svrOnline 
script???  Thanks!
> 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
> 
>  
> 
> -----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
> 
>  
> 
> 

********************************************************
This Week's Sponsor - 99Point9.Com Emergent Online
EOL Universal Printer 4.0 Has arrived!
http://www.99point9.com/public/products/
*********************************************************
Useful Thin Client Computing Links are available at:
http://thethin.net/links.cfm
***********************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm

Other related posts: