<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://dverweij.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fdverweij.spaces.live.com%2fcategory%2fCitrix%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Just Powershell it: Citrix</title><description /><link>http://dverweij.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catCitrix</link><language>en-US</language><pubDate>Sat, 12 Jul 2008 01:36:10 GMT</pubDate><lastBuildDate>Sat, 12 Jul 2008 01:36:10 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://dverweij.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>-6645245869990399496</live:id><live:alias>dverweij</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>Import Citrix published applications</title><link>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!128.entry</link><description>&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;After exporting the published application setting in an earlier post, here is the script I used to import the applications in the new farm.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# Powershell script&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# Citrix Export published applications&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# D. Verweij&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;#&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;###&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;# First the known steps to connect to the mfcom and initialize the object&lt;/font&gt;&lt;/em&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" face="Verdana, Geneva, Arial, Sans-serif" color="#ffffff"&gt;$c_farm = new-object -com metaframecom.metaframefarm&lt;br&gt;$c_farm.initialize(1)&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;# Then we import the csv file and for each we do..&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" face="Verdana, Geneva, Arial, Sans-serif" color="#ffffff"&gt;import-csv c:\citrix\Citrix_apps.csv | foreach{&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" face="Verdana, Geneva, Arial, Sans-serif" color="#ffffff"&gt; $c_app=$c_farm.addapplication($_.apptype)&lt;br&gt; $w_app = $c_app.winappobject&lt;br&gt; $c_app.Appname = $_.appname&lt;br&gt; $c_app.description = $_.description&lt;br&gt; $w_app.defaultencryption = $_.defaultencryption&lt;br&gt; $w_app.defaultinitprog = $_.defaultinitprog&lt;br&gt; $w_app.defaultworkdir = $_.defaultworkdir&lt;br&gt; $w_app.browsername = $_.browsername&lt;br&gt; $w_app.enableapp = $_.enableapp&lt;br&gt; $w_app.hidefrompnenum = $_.hidefrompnenum&lt;br&gt; $w_app.hidefrombrowserenum = $_.hidefrombrowserenum&lt;br&gt; $w_app.defaultwindowcolor = $_.defaultwindowcolor&lt;br&gt; $w_app.defaultwindowtype = $_.defaultwindowtype&lt;br&gt; $w_app.defaultsoundtype = $_.defaultsoundtype&lt;br&gt; $w_app.desktopintegrate = $_.desktopintegrate&lt;br&gt; $w_app.mfattributes = $_.mfattributes&lt;br&gt; $w_app.publishingflags = $_.publishingflags&lt;br&gt; $w_app.PNAttributes = $_.PNAttributes&lt;br&gt; $w_app.AllowMultiInstancePerUser = $_.AllowMultiInstancePerUser&lt;br&gt; $w_app.StartMenuFolder = $_.StartMenuFolder&lt;br&gt; $w_app.PlaceUnderProgramsFolder = $_.PlaceUnderProgramsFolder&lt;br&gt; $w_app.WaitOnPrinterCreation = $_.WaitOnPrinterCreation&lt;br&gt; $w_app.defaultwindowwidth = $_.defaultwindowwidth&lt;br&gt; $w_app.defaultwindowheight = $_.defaultwindowheight&lt;br&gt; $w_app.defaultwindowscale = $_.defaultwindowscale&lt;br&gt; $w_app.parentfolderDN = $_.parentfolderDN&lt;br&gt; $w_app.pnfolder = $_.pnfolder&lt;br&gt; $c_app.savedata()&lt;br&gt;}&lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Of course there are much more settings to specify and the above are just the one I needed. To see the complete list, just use the &amp;quot;get-member&amp;quot; :&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399"&gt;$farm = new-object -com metaframecom.metaframefarm&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399"&gt;$farm.initialize(1)&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399"&gt;$farm.applications|get-member&lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;note! for some additional settings you need the winappobject properties (some properties in the script above are winappobject properties). The members of winappobject are shown the same way, but you will first have to choose an application:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;For instance:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399"&gt;$sampleapp = $farm.applications|where {$_.appname -like &amp;quot;sampleapp&amp;quot;}   # appname is the displayname of the published app&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399"&gt;$sampleapp.winappobject|get-member&lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;**update**&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If you haven't already, you should take a look at the post on &lt;a href="http://blogs.msdn.co/powershell"&gt;http://blogs.msdn.co/powershell&lt;/a&gt; where Jeffrey Snover did some tuning on my script. I haven't had the time to test it yet, but I will and you should too. It's great.&lt;/div&gt;
&lt;div&gt;The post can be found here:&lt;/div&gt;
&lt;div&gt;&lt;a href="http://blogs.msdn.com/powershell/archive/2006/12/29/use-copy-property-to-make-it-easier-to-write-read-and-review-scripts.aspx" rel=nofollow&gt;&lt;font color="#0066cc"&gt;http://blogs.msdn.com/powershell/archive/2006/12/29/use-copy-property-to-make-it-easier-to-write-read-and-review-scripts.aspx&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Have fun!&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Grt&lt;/div&gt;
&lt;div&gt;Dennis&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6645245869990399496&amp;page=RSS%3a+Import+Citrix+published+applications&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dverweij.spaces.live.com&amp;amp;GT1=dverweij"&gt;</description><comments>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!128.entry#comment</comments><guid isPermaLink="true">http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!128.entry</guid><pubDate>Fri, 29 Dec 2006 07:33:23 GMT</pubDate><slash:comments>3</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dverweij.spaces.live.com/blog/cns!A3C75816DA1731F8!128/comments/feed.rss</wfw:commentRss><wfw:comment>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!128.entry#comment</wfw:comment><dcterms:modified>2007-01-15T07:40:49Z</dcterms:modified></item><item><title>Export Citrix published applications</title><link>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!126.entry</link><description>&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;During a migration of our Citrix farm to Presentation Server 4.0, I needed to export the published applications from the old Metaframe farm.&lt;/div&gt;
&lt;div&gt;I wanted the export to be a csv file with all the properties to recreate the applications in the new farm.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So, for this I made the following script.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# Powershell script&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# Citrix Export published applications&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# D. Verweij&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;#&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;###&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;# First the known steps to connect to the mfcom and initialize the object&lt;/font&gt;&lt;/em&gt; &lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;$c_farm = new-object –com metaframecom.metaframefarm&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;$c_farm.initialize(1) &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# Now we read the properties of the published applications&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;$c_farm.applications|select-object &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.appname};n='appname'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.groups|foreach {$_.groupname}};n='groupname'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.users|foreach{$_.username}};n='username'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.distinguishedname};n='distinguishedname'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.description};n='description'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.apptype};n='apptype'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.browsername};n='browsername'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.enableapp};n='enableapp'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.hidefrompnenum};n='hidefrompnenum'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.hidefrombrowserenum};n='hidefrombrowserenum'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultencryption};n='defaultencryption'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultinitprog};n='defaultinitprog'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultworkdir};n='defaultworkdir'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultwindowwidth};n='defaultwindowwidth'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultwindowheight};n='defaultwindowheight'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultwindowcolor};n='defaultwindowcolor'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultwindowtype};n='defaultwindowtype'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultsoundtype};n='defaultsoundtype'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.defaultwindowscale};n='defaultwindowscale'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.desktopintegrate};n='desktopintegrate'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.mfattributes};n='mfattributes'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.publishingflags};n='publishingflags'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.PNAttributes};n='PNAttributes'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.PNFolder};n='PNFolder'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.parentfolderDN};n='parentfolderDN'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.AllowMultiInstancePerUser};n='AllowMultiInstancePerUser'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.StartMenuFolder};n='StartMenuFolder'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.PlaceUnderProgramsFolder};n='PlaceUnderProgramsFolder'},&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;@{e={$_.winappobject.WaitOnPrinterCreation};n='WaitOnPrinterCreation'}|&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#c0c0c0"&gt;&lt;em&gt;# The last step is to pipe this to the export-csv cmdlet&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;export-csv c:\citrix\Citrix_apps.csv &lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Later on I'll go on with importing these apps. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Grt&lt;/div&gt;
&lt;div&gt;Dennis&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6645245869990399496&amp;page=RSS%3a+Export+Citrix+published+applications&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dverweij.spaces.live.com&amp;amp;GT1=dverweij"&gt;</description><comments>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!126.entry#comment</comments><guid isPermaLink="true">http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!126.entry</guid><pubDate>Thu, 28 Dec 2006 14:26:05 GMT</pubDate><slash:comments>1</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dverweij.spaces.live.com/blog/cns!A3C75816DA1731F8!126/comments/feed.rss</wfw:commentRss><wfw:comment>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!126.entry#comment</wfw:comment><dcterms:modified>2006-12-28T14:26:05Z</dcterms:modified></item><item><title>Citrix connection</title><link>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!111.entry</link><description>&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;For the one that doesn't know: Yes, you can do all the crazy stuff in citrix from the wonderfull world of the commandline as you can in the cmc....and more.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;A lot of stuff about the com, named MFCOM is written in the pdf &amp;quot;scripting metaframe&amp;quot;. (&lt;a href="http://support.citrix.com/article/CTX106885"&gt;http://support.citrix.com/article/CTX106885&lt;/a&gt;) This document is namely for doing stuff with vbscript, but with al little trail and error and a bit of smart thinking you can use this document to begin powershelling the citrix world. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I'll just post some simple scripts to begin with and I hope this wil trigger you to try things yourself and ofcourse.....share it !&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Let's do an automated enable and disable of a number of published applications.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;First we close them&lt;/div&gt;
&lt;div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;#--&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;em&gt;&lt;font style="background-color:#333399" color="#999999"&gt;#first we have to connect to the farm. We do this with new-object and specify that it's a -com object. You don't have to specify the farm name, because it connects to the farm you're in by default.&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;$citrixfarm = new-object -com metaframecom.metaframefarm&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;&lt;em&gt;&lt;font color="#999999"&gt;#Then, the farm has to be initialized. &lt;br&gt;&lt;/font&gt;&lt;/em&gt;$citrixfarm.initialize(1)&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;&lt;em&gt;&lt;font color="#999999"&gt;#To close multiple published apps, we need al list of applications. I've put those in a text file. Note that you have to specify the distinguishedname of the application. So, for instance: Applications/Windows/Notepad&lt;br&gt;&lt;/font&gt;&lt;/em&gt;gc &amp;quot;c:\scripts\citrixapps\citrixapps.txt&amp;quot; |foreach &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;{&lt;br&gt;   $disting=$_&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;/em&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;   &lt;em&gt;&lt;font color="#999999"&gt;#To see the progress in the commandline I've put in the echo below&lt;br&gt;&lt;/font&gt;&lt;/em&gt;   echo &amp;quot;Busy closing --&amp;gt; &amp;quot;+$disting&lt;br&gt;   $citrixapps = $citrixfarm.applications|where {$_.DistinguishedName -like $disting}&lt;br&gt;   $citrixapps.enableapp = 0&lt;br&gt;   $citrixapps.savedata()&lt;br&gt;}&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;#--&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;And....that's all to close them down. Now we'll open them in pretty much the same way. Actually the only difference is putting &amp;quot;enableapp&amp;quot; to &amp;quot;1&amp;quot;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;#--&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;$citrixfarm = new-object -com metaframecom.metaframefarm&lt;br&gt;$citrixfarm.initialize(1)&lt;br&gt;gc c:\scripts\citrixapps\citrixapps.txt |foreach &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color:#333399" color="#ffffff"&gt;{&lt;br&gt;   $disting=$_&lt;br&gt;   &amp;quot;Busy opening --&amp;gt; &amp;quot;+$disting&lt;br&gt;   $citrixapps = $citrixfarm.applications|where {$_.DistinguishedName -like $disting}&lt;br&gt;   $citrixapps.enableapp = 1&lt;br&gt;   $citrixapps.savedata()&lt;br&gt;}&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;#--&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;try and enjoy&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Dennis&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6645245869990399496&amp;page=RSS%3a+Citrix+connection&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dverweij.spaces.live.com&amp;amp;GT1=dverweij"&gt;</description><comments>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!111.entry#comment</comments><guid isPermaLink="true">http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!111.entry</guid><pubDate>Wed, 27 Dec 2006 13:44:28 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dverweij.spaces.live.com/blog/cns!A3C75816DA1731F8!111/comments/feed.rss</wfw:commentRss><wfw:comment>http://dverweij.spaces.live.com/Blog/cns!A3C75816DA1731F8!111.entry#comment</wfw:comment><dcterms:modified>2006-12-28T13:39:04Z</dcterms:modified></item></channel></rss>