<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andrew Morgan &#187; IT</title>
	<atom:link href="http://andrewmorgan.ie/tag/it/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewmorgan.ie</link>
	<description>Grumpy ramblings</description>
	<lastBuildDate>Fri, 30 Jun 2017 09:24:25 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Deleting Files older than X, Forfiles.exe.</title>
		<link>http://andrewmorgan.ie/2008/02/deleting-files-older-than-x-forfilesexe/</link>
		<comments>http://andrewmorgan.ie/2008/02/deleting-files-older-than-x-forfilesexe/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 10:12:50 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Batch]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://joekickass.wordpress.com/?p=31</guid>
		<description><![CDATA[As part of my recent Citrix cleanup i found the need to clear down an applications log files folder, this folder existed in the program files directory and was eating up gb&#8217;s of space with useless logs. The only difference between these files and standard logs was that sometimes recovery was neccessary so it was agreed that a 7 day retention would be kept. With the 7 day retention it made it slightly more complicated to batch, but with a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p align="left"><img class="alignright" src="/wp-content/uploads/2008/07/images.jpg?w=144&amp;h=108" alt="" width="144" height="108" />As part of my recent Citrix cleanup i found the need to clear down an applications log files folder, this folder existed in the program files directory and was eating up gb&#8217;s of space with useless logs. The only difference between these files and standard logs was that sometimes recovery was neccessary so it was agreed that a 7 day retention would be kept.</p>
<p>With the 7 day retention it made it slightly more complicated to batch, but with a little searching and trial/error i present to you <a href="http://technet2.microsoft.com/windowsserver/en/library/9660fea1-65c7-48cf-b466-204ba159381e1033.mspx?mfr=true">forfiles</a>. As far as I&#8217;m aware this program comes with server 2003 tools, but could be wrong. a bit of googling will find you a copy.</p>
<p>Forfiles allows you to execute individual commands for files that meet certain criteria, in my case it was the Date index. Not only this but it allows for &amp; commands&#8230; excellent little batch tool!</p>
<blockquote><p><em>forfiles -d -8 -c &#8220;cmd /c echo Deleted: @file @fdate &gt;&gt; %apath% &amp; del @file&#8221;</em></p></blockquote>
<p>Once i had decided it was forfiles i was going to use, i had a few options. but seeing as this tool was not on all servers, and i wanted to log it centrally with the least ammount of logging, i chose to run it from central.</p>
<p>Below is a step by step of what i did.</p>
<blockquote><p>@echo off<br />
set apath=c:avyaclean.log<br />
echo. &gt;&gt; %apath%<br />
echo.Time Starting: %time% &gt;&gt; %apath%<br />
Pushd Servernamec$Program Filesapplogs<br />
forfiles -d -8 -c &#8220;cmd /c echo Deleted: @file @fdate &gt;&gt; %apath% &amp; del @file&#8221;<br />
echo. &gt;&gt; %apath%<br />
echo. Finished @ %time% &gt;&gt; %apath%<br />
popd<br />
EXIT</p></blockquote>
<p>The meat of this statement is here: forfiles -d -8 -c &#8220;cmd /c echo Deleted: @file @fdate &gt;&gt; %apath% &amp; del @file&#8221;. this basically says, any files older than 8 days (modified, not created date) run a command prompt that echos the file name and modify date to a text file specified &amp; <strong>delete</strong> the file.</p>
<p>You can do this on as many servers as you like, just change the servername and copy and paste <img src="http://andrewmorgan.ie/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/02/deleting-files-older-than-x-forfilesexe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handy Search Trick</title>
		<link>http://andrewmorgan.ie/2007/09/handy-search-trick/</link>
		<comments>http://andrewmorgan.ie/2007/09/handy-search-trick/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 13:53:57 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Batch]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://joekickass.wordpress.com/?p=26</guid>
		<description><![CDATA[Want to run a few searches? cant be arsed with the slow console in the shell or the stupid search assitant? open a cmd prompt open the root directory (cd ) and do a Dir /s whatever*. handy for multiple searches and doesnt kill your session&#8230; try to use wildcards (*&#8217;s) as its a bit fussy]]></description>
				<content:encoded><![CDATA[<p>Want to run a few searches? cant be arsed with the slow console in the shell or the stupid search assitant?<img class="alignright" src="/wp-content/uploads/2008/07/images.jpg?w=144&amp;h=108&amp;h=108" alt="" width="144" height="108" /></p>
<p>open a cmd prompt</p>
<p>open the root directory (cd ) and do a <strong><em>Dir /s whatever*.</em></strong></p>
<p>handy for multiple searches and doesnt kill your session&#8230; try to use wildcards (*&#8217;s) as its a bit fussy <img src="http://andrewmorgan.ie/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2007/09/handy-search-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Services fail to start, Citrix</title>
		<link>http://andrewmorgan.ie/2007/08/services-fail-to-start-citrix/</link>
		<comments>http://andrewmorgan.ie/2007/08/services-fail-to-start-citrix/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 18:50:57 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Citrix]]></category>
		<category><![CDATA[XenApp]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Server 2003]]></category>

		<guid isPermaLink="false">http://joekickass.wordpress.com/?p=25</guid>
		<description><![CDATA[&#8220;Error 1069: The service did not start due to a logon failure when attempting to manually start either the Citrix SMA Service or the Citrix Print Manager Service&#8221; In a nutshell this means that your sma user (Ctx_SmaUser in 4.0) is fubar&#8217;d. To get over this, you could do all this (and i really do mean ALL) or you could run this new application. Very handy little tool altogether for when that user account just crashes and burns. having had [&#8230;]]]></description>
				<content:encoded><![CDATA[<p align="left"><img class="alignright" src="/wp-content/uploads/2011/08/000_ica_h32bit_256-e1314697167561.png?w=90&amp;h=90" alt="" width="90" height="90" /><em>&#8220;Error 1069: The service did not start due to a logon failure when attempting to manually start either the Citrix SMA Service or the Citrix Print Manager</em><em> Service&#8221;</em></p>
<p>In a nutshell this means that your sma user (Ctx_SmaUser in 4.0) is fubar&#8217;d.</p>
<p>To get over this, you could do <a href="http://support.citrix.com/article/CTX106661" target="_blank">all this</a> (and i really do mean ALL) or you could run this <a href="http://support.citrix.com/article/CTX111464">new application</a>.</p>
<p>Very handy little tool altogether for when that user account just crashes and burns. having had to do it the old way I can in no uncertain terms tell you just how easier this will make your life!</p>
<p><img src="http://support.citrix.com/article/html/images/CTX111464-1.gif" alt="" width="575" height="378" /></p>
<p>Make sure to download the app to a nice handy location (c: for example) and run it from a command prompt, don&#8217;t just feckin double click it, it gives feedback <img src="http://andrewmorgan.ie/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2007/08/services-fail-to-start-citrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
