script problem, in the Scripting / Automation forum on BrianMadden.com
Brian Madden Logo
Your independent source for desktop virtualization, consumerization, and enterprise mobility management.

script problem, in the Scripting / Automation forum on BrianMadden.com

rated by 0 users
This post has 5 Replies | 0 Followers

Guest Posted: Fri, Oct 14 2005 9:05 AM
Below is a script I am trying to use myself borrowed from the citrix site to remove a server from a pub app.
When I run it I get "If no parameters specified, quit and
' show the usage of the script"

Obviously I am not doing something, should I be replacing something in the script for my specific farm?

thanks







File: RemoveAppFromALLServers.wsf
Description: Exanmple of Remove App from all Servers .
Requirements: WSH 5.5 or higher.






Remove App from a All server .


CScript //nologo RemoveAppFromAllServers.wsf Applications/calc






Dim AppDN, theApp,Found
Found = false

'
' If no parameters specified, quit and
' show the usage of the script
'
if WScript.Arguments.Count
WScript.Echo "USAGE: RemoveAppFromAllServers.wsf AppDN "
WScript.Echo ""
WScript.Echo "Example: RemoveAppFromAllServers.wsf Applications/calc "
WScript.Quit 0
Else
AppDN = WScript.Arguments(0)
WScript.Echo "RemoveAppFromAllServers Application: " & AppDN
WScript.Echo ""
End If

'
' Create App object
'

Set theApp = CreateObject("MetaFrameCOM.MetaFrameApplication")
if Err.Number
WScript.Echo "Can't create MetaFrameApplication object"
WScript.Echo "(" & Err.Number & ") " & Err.Description
WScript.Echo ""
WScript.Quit Err.Number
End if

'
' Initialize the app object.
'

theApp.Initialize MetaFrameWinAppObject, AppDN
if Err.Number
WScript.Echo "Can't Initialize Application object"
WScript.Echo "(" & Err.Number & ") " & Err.Description
WScript.Echo ""
WScript.Quit Err.Number
End if
'You can add checking for whether App exists before .

'Load APP data
theApp.LoadData(1)



'
' Remove the Application from server.
'

theApp.RemoveAllServers()
if Err.Number
WScript.Echo "Can't Remove app from servers"
WScript.Echo "(" & Err.Number & ") " & Err.Description
WScript.Echo ""
WScript.Quit Err.Number
End if

'Saving data.
theApp.SaveData()

WScript.Echo "Removed App From All Servers successfully"








  • | Post Points: 5
Guest replied on Fri, Oct 14 2005 9:07 AM
also I notice some scripts are wsf and others are vbs, whats the difference , is one better than the other?
  • | Post Points: 5
Guest replied on Fri, Oct 14 2005 2:06 PM
Make sure you enter the AppDN parameter which specifies where the application is (in CMC)
Example
RemoveAppFromAllServers.wsf Applications/calc

  • | Post Points: 5
Guest replied on Mon, Oct 17 2005 10:01 AM
thanks
  • | Post Points: 5
Guest replied on Tue, Oct 18 2005 8:18 AM
still struggling with this,
tried it on notepad, so I changed it to
RemoveAppFromAllServers.wsf Applications/notepad but still doesnt work

just shows example

Am i supposed to replace AppDN with applications/notepad ?
  • | Post Points: 20
Not Ranked
Points 95

Try this script from Citrix4ge...

Citrix4ge
  • | Post Points: 5
Page 1 of 1 (6 items) | RSS