
{"id":690,"date":"2011-10-21T23:17:01","date_gmt":"2011-10-21T23:17:01","guid":{"rendered":"http:\/\/tech-no.104.210.61.21.xip.io\/?p=690"},"modified":"2011-10-21T23:17:20","modified_gmt":"2011-10-21T23:17:20","slug":"citrix-script-to-allow-you-to-disable-published-applications-using-the-task-scheduler","status":"publish","type":"post","link":"https:\/\/tech-no.org\/?p=690","title":{"rendered":"Citrix: Script to allow you to disable published applications using the task scheduler!"},"content":{"rendered":"<p><a href=\"http:\/\/tech-no.104.210.61.21.xip.io\/wp-content\/uploads\/sites\/4\/2011\/05\/citrix.jpg\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-272\" title=\"citrix\" src=\"http:\/\/tech-no.104.210.61.21.xip.io\/wp-content\/uploads\/sites\/4\/2011\/05\/citrix.jpg\" alt=\"\" width=\"257\" height=\"101\" srcset=\"https:\/\/tech-no.org\/wp-content\/uploads\/sites\/4\/2011\/05\/citrix.jpg 257w, https:\/\/tech-no.org\/wp-content\/uploads\/sites\/4\/2011\/05\/citrix-150x58.jpg 150w\" sizes=\"(max-width: 257px) 100vw, 257px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>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:<\/p>\n<blockquote><p>Save this as vbs file. This script will disable an app after prompting for the<br \/>\nappname.<br \/>\nI included subroutine<wbr>s for both enabling and disabling<br \/>\napp<br \/>\ndepending on what you want, comment out the lines where the<br \/>\nsubroutine<wbr> is<br \/>\ncalled.<br \/>\n&#8216;=========<wbr>============<wbr>============<wbr>============<wbr>============<wbr>============<wbr>====<br \/>\n&#8216;This<br \/>\nscript is tested successful<wbr>ly in XPE FR3 farm using mfcom<br \/>\n&#8216;SDK<br \/>\nversion 2.3<br \/>\n&#8216;Legal Disclamier<br \/>\n&#8216;Test this script in your test<br \/>\nenvironmen<wbr>t before using in production<br \/>\n&#8216;Use at your own risk, me<br \/>\nor the company i work for is not responsibl<wbr>e For<br \/>\n&#8216;any issues this<br \/>\nscript might cause in your<br \/>\nenvironmen<wbr>t<br \/>\n&#8216;=========<wbr>============<wbr>============<wbr>============<wbr>============<wbr>============<wbr>====<br \/>\nset<br \/>\nfarm=creat<wbr>eobject(&#8220;met<wbr>aframecom.me<wbr>taframefarm&#8221;<wbr>)<br \/>\nfarm.initi<wbr>alize<br \/>\n1<br \/>\nConst MetaframeW<wbr>inAppObject=<wbr>3<br \/>\nConst<br \/>\nAppEnabled<wbr>=1<br \/>\nConst<br \/>\nAppDisable<wbr>d=0<\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/p>\n<p>appinput=i<wbr>nputbox(&#8220;Ent<wbr>er<br \/>\nthe Applicatio<wbr>n Name to be enabled:&#8221;)<\/wbr><\/wbr><\/wbr><\/p>\n<p>&#8216;For schedule Task,<br \/>\ncomment above line and uncomment following line, by hard-codin<wbr>g<br \/>\nappname<br \/>\n&#8216;appinput=<wbr>&#8220;exceed&#8221; &#8216;If exceed needs to be<br \/>\ndisabled<\/wbr><\/wbr><\/p>\n<p>for each app in farm.appli<wbr>cations<br \/>\nif<br \/>\nucase(app.<wbr>appname)=uca<wbr>se(appinput)<wbr><br \/>\nthen<br \/>\nWscript.ec<wbr>ho &#8220;App<br \/>\nFound&#8221;<br \/>\nappDN=app.<wbr>distinguishe<wbr>dname<br \/>\n&#8216;Call<br \/>\nEnableApp(<wbr>) &#8216;Enable App<br \/>\nCall DisableApp<wbr>() &#8216;Disable<br \/>\nApp<br \/>\nend if<br \/>\nnext<\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/p>\n<p>Sub EnableApp(<wbr>)<br \/>\nset<br \/>\napp1=creat<wbr>eobject(&#8220;Met<wbr>aframecom.me<wbr>taframeappli<wbr>cation&#8221;)<br \/>\napp1.Initi<wbr>alize<br \/>\nMetaframeW<wbr>inAppObject,<wbr>appDN<br \/>\napp1.loadd<wbr>ata(true)<br \/>\napp1.Enabl<wbr>eApp=AppEnab<wbr>led<br \/>\napp1.saved<wbr>ata()<br \/>\nWScript.Ec<wbr>ho<br \/>\n&#8220;Applicati<wbr>on: &#8220;&amp;Ucas<wbr>e(appinput)&amp;<wbr>#38;&#8221;<br \/>\nIs enabled&#8221;<br \/>\nEnd Sub<\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/p>\n<p>Sub DisableApp<wbr>()<br \/>\nset<br \/>\napp1=creat<wbr>eobject(&#8220;Met<wbr>aframecom.me<wbr>taframeappli<wbr>cation&#8221;)<br \/>\napp1.Initi<wbr>alize<br \/>\nMetaframeW<wbr>inAppObject,<wbr>appDN<br \/>\napp1.loadd<wbr>ata(true)<br \/>\napp1.Enabl<wbr>eApp=AppDisa<wbr>bled<br \/>\napp1.saved<wbr>ata()<br \/>\nWScript.Ec<wbr>ho<br \/>\n&#8220;Applicati<wbr>on: &#8220;&amp;Ucas<wbr>e(appinput)&amp;<wbr>#38;&#8221;<br \/>\nIs disabled&#8221;<br \/>\nEnd Sub<\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/wbr><\/p>\n<p>set farm=Nothi<wbr>ng<br \/>\nset<br \/>\napp1=Nothi<wbr>ng<\/wbr><\/wbr><\/p>\n<p>wscript.ec<wbr>ho &#8220;DONE&#8221;<\/wbr><\/p><\/blockquote>\n<p>here is the original link for the curious: <a title=\"http:\/\/forums.citrix.com\/thread.jspa?messageID=208886&amp;fromSearchPage=true&amp;\" href=\"http:\/\/forums.citrix.com\/thread.jspa?messageID=208886&amp;fromSearchPage=true&amp;\" target=\"_blank\">http:\/\/forums.citrix.com\/thread.jspa?messageID=208886&amp;fromSearchPage=true&amp;<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<p>Fun stuff<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; &nbsp; &nbsp; 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 &hellip;<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts\/690"}],"collection":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=690"}],"version-history":[{"count":3,"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts\/690\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts\/690\/revisions\/693"}],"wp:attachment":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}