Today i was curious if it was possible to disable applications in Citrix at a specified time. A little bit of Googling later and i found this script:
Save this as vbs file. This script will disable an app after prompting for the
appname.
I included subroutines for both enabling and disabling
app
depending on what you want, comment out the lines where the
subroutineis
called.
‘===================== ============ ============ ============ ============ ====
‘This
script is tested successfully in XPE FR3 farm using mfcom
‘SDK
version 2.3
‘Legal Disclamier
‘Test this script in your test
environment before using in production
‘Use at your own risk, me
or the company i work for is not responsible For
‘any issues this
script might cause in your
environment
‘===================== ============ ============ ============ ============ ====
set
farm=createobject(“met aframecom.me taframefarm” )
farm.initialize
1
Const MetaframeWinAppObject= 3
Const
AppEnabled=1
Const
AppDisabled=0 appinput=i
nputbox(“Ent er
the Application Name to be enabled:”) ‘For schedule Task,
comment above line and uncomment following line, by hard-coding
appname
‘appinput=“exceed” ‘If exceed needs to be
disabledfor each app in farm.appli
cations
if
ucase(app.appname)=uca se(appinput)
then
Wscript.echo “App
Found”
appDN=app.distinguishe dname
‘Call
EnableApp() ‘Enable App
Call DisableApp() ‘Disable
App
end if
nextSub EnableApp(
)
set
app1=createobject(“Met aframecom.me taframeappli cation”)
app1.Initialize
MetaframeWinAppObject, appDN
app1.loaddata(true)
app1.EnableApp=AppEnab led
app1.savedata()
WScript.Echo
“Application: “&Ucas e(appinput)& #38;”
Is enabled”
End SubSub DisableApp
()
set
app1=createobject(“Met aframecom.me taframeappli cation”)
app1.Initialize
MetaframeWinAppObject, appDN
app1.loaddata(true)
app1.EnableApp=AppDisa bled
app1.savedata()
WScript.Echo
“Application: “&Ucas e(appinput)& #38;”
Is disabled”
End Subset farm=Nothi
ng
set
app1=Nothing wscript.ec
ho “DONE”
here is the original link for the curious: http://forums.citrix.com/thread.jspa?messageID=208886&fromSearchPage=true&
This is great so if you know you have a maintenance window that you want certain apps offline, you can schedule this so users cannot log in to them via citrix.
Fun stuff