<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>the back room tech &#187; script</title>
	<atom:link href="http://thebackroomtech.com/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://thebackroomtech.com</link>
	<description>serving up the info back room techs everywhere find interesting</description>
	<lastBuildDate>Thu, 19 Nov 2009 18:19:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='thebackroomtech.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/a33574f02dbbfb9cc6104c10ba197e25?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>the back room tech &#187; script</title>
		<link>http://thebackroomtech.com</link>
	</image>
			<item>
		<title>Script to find and email files in a directory</title>
		<link>http://thebackroomtech.com/2009/11/16/script-to-find-and-email-files-in-a-directory/</link>
		<comments>http://thebackroomtech.com/2009/11/16/script-to-find-and-email-files-in-a-directory/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 18:49:29 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[script]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[blat]]></category>
		<category><![CDATA[blat.exe]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://thebackroomtech.com/?p=2036</guid>
		<description><![CDATA[I needed to write a batch file that would email some files, and could be run as a scheduled task.  I chose to use Blat as my email program, you can download it for free from SourceForge.
The batch file requirements were: 
1.  Had to email all the .xls files in one directory from the current date.  Luckily for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=2036&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I needed to write a batch file that would email some files, and could be run as a scheduled task.  I chose to use Blat as my email program, you can <a href="http://sourceforge.net/projects/blat">download it</a> for free from SourceForge.</p>
<p>The batch file requirements were: </p>
<div>1.  Had to email all the .xls files in one directory from the current date.  Luckily for me the date was in the file name, so I just had to find all files in the format *MMDDYY*.xls</div>
<div> </div>
<div>2.  The emails had to be sent &#8220;To&#8221; some users, then &#8220;CC&#8221;d to others</div>
<div> </div>
<div>3.  I could only use free software (no shareware) but could use our internal smtp replay server to send the mail through.</div>
<div> </div>
<div>4. The Scheduled task that executes the script must run on a Windows 2003 server.</div>
<div> </div>
<div>The following script is what I came up with.  I&#8217;ll go through it line by line, then post the entire thing at the end.</div>
<div> </div>
<div>****************************************************</div>
<div> </div>
<div><span style="color:#800000;">Here I&#8217;m getting the current date in the month month day day year year format, and saving it to a variable named search.  This can obviously be changed to meet your particular need</span></div>
<div>REM set search date variable in MMDDYY format for file search</div>
<div>REM set search to month-date-year for date formatting</div>
<div>for /f &#8220;Tokens=1-4 Delims=/ &#8221; %%i in (&#8216;date /t&#8217;) do set search=%%j%%k%%l</div>
<div> </div>
<div><span style="color:#800000;">Adding a blank line to the log file ReportLog.txt since I like my logs nice and neat. Makes them easy to read.</span></div>
<div>echo. &gt;&gt; ReportLog.txt</div>
<div> </div>
<div><span style="color:#800000;">Writing the date and time the script starts to the log file ReportLog.txt</span></div>
<div>echo %date% %time% Starting script &gt;&gt; ReportLog.txt</div>
<div> </div>
<div><span style="color:#800000;">Using the variable search, which contains the current date, I&#8217;m getting a list of all .xls files from today and saving it in FileNames.txt</span></div>
<div>dir /b &#8220;\\server\share\%search%*.xls&#8221; &gt; FileNames.txt</div>
<div> </div>
<div><span style="color:#800000;">If there&#8217;s a problem retrieving the names of the files, write a message to the log file</span></div>
<div>IF ERRORLEVEL 1 (echo %date% %time%  problem with retrieving file names &gt;&gt; ReportLog.txt)</div>
<div> </div>
<div><span style="color:#800000;">Using find /c to count how many files are in filenames.txt, and saving that number in the variable NUMFILES</span></div>
<div>for /f &#8220;tokens=3&#8243; %%i in (&#8216;find /v /c &#8220;SomeStringNotToBeFound&#8221; filenames.txt&#8217;) do set NUMFILES=%%i</div>
<div> </div>
<div><span style="color:#800000;">If the variable NumFiles equals zero, there were no files found for today.  Skip to ZEROFILES to send an email alert</span></div>
<div>If %NUMFILES% EQU 0 GOTO ZEROFILES</div>
<div> </div>
<div><span style="color:#800000;">If NUMFILES isn&#8217;t zero, then files exist that need to be emailed.  There may be more than one file, so we&#8217;re going to use a loop to process all the files listed in FileNames.txt</span></div>
<div>For /F &#8220;tokens=1-2* delims=&#8221; %%B IN (FileNames.txt) DO (</div>
<div> </div>
<div><span style="color:#800000;">write the name of the file to the log file</span></div>
<div>echo file to email is %%B &gt;&gt; ReportLog.txt</div>
<div> </div>
<div><span style="color:#800000;">Use blat.exe to send the email to addresses specified in tolist.txt</span></div>
<div><span style="color:#800000;">Use blat.exe to send emails as CC to addresses specified in cclist.txt</span></div>
<div><span style="color:#800000;">Attached file is listed at the end of the command</span></div>
<div><span style="color:#800000;">This command is all one line, it may wrap on the page</span></div>
<div>blat.exe -tf tolist.txt -cf cclist.txt -subject &#8220;Report %%B&#8221; -body &#8220;Here is the current report.&#8221; -server smtp.yourdomain.com -f <a href="mailto:sender@yourdomain.com">sender@yourdomain.com</a> -attach &#8220;\\server\share\%%B&#8221;</div>
<div>)</div>
<div> </div>
<div><span style="color:#800000;">We&#8217;re done emailing the files, so skip over to WRITELOG</span></div>
<div>goto WRITELOG</div>
<div> </div>
<div><span style="color:#800000;">Zero files were found, so we need to send an email alert</span></div>
<div>:ZEROFILES</div>
<div> </div>
<div><span style="color:#800000;">write the name of the file to the log file, along with the date and time</span></div>
<div>echo %date% %time%  problem with retrieving number of current files &gt;&gt; ReportLog.txt</div>
<div> </div>
<div><span style="color:#800000;">Use blat.exe to send an email alert to addresses specified in problist.txt</span></div>
<div><span style="color:#800000;">This command is all one line, it may wrap on the page</span></div>
<div>blat.exe -tf problist.txt -subject &#8220;Problem with Report&#8221; -body &#8220;Problem sending the current report.&#8221; -server smtp.yourdomain.com -f <a href="mailto:sender@yourdomain.com">sender@yourdomain.com</a></div>
<div> </div>
<div><span style="color:#800000;">Writing the date and time the script starts to the log file ReportLog.txt</span></div>
<div>:WRITELOG</div>
<div>echo %date% %time% Ending Script &gt;&gt; ReportLog.txt</div>
<div> </div>
<div>****************************************************</div>
<div> </div>
<div>The script in it&#8217;s entirely:</div>
<div> </div>
<div>REM set search date variable in MMDDYY format for file search</div>
<div>REM set search to month-date-year for date formatting</div>
<div>for /f &#8220;Tokens=1-4 Delims=/ &#8221; %%i in (&#8216;date /t&#8217;) do set search=%%j%%k%%l</div>
<div> </div>
<div> </div>
<div>REM format ReportLog.txt</div>
<div>echo. &gt;&gt; ReportLog.txt</div>
<div>echo %date% %time% Starting script &gt;&gt; ReportLog.txt</div>
<div> </div>
<div> </div>
<div>REM Get the names of all log files for specified date, save to FileNames.txt</div>
<div>dir /b &#8220;\\server\share\%search%*.xls&#8221; &gt; FileNames.txt</div>
<div>IF ERRORLEVEL 1 (echo %date% %time%  problem with retrieving file names &gt;&gt; ReportLog.txt)</div>
<div> </div>
<div>REM Count how many files are in filenames.txt, put into %NUMFILES%</div>
<div>for /f &#8220;tokens=3&#8243; %%i in (&#8216;find /v /c &#8220;SomeStringNotToBeFound&#8221; filenames.txt&#8217;) do set NUMFILES=%%i</div>
<div> </div>
<div>If %NUMFILES% EQU 0 GOTO ZEROFILES</div>
<div> </div>
<div>REM loop when more than one file to be emailed</div>
<div>For /F &#8220;tokens=1-2* delims=&#8221; %%B IN (FileNames.txt) DO (</div>
<div>echo file to email is %%B &gt;&gt; ReportLog.txt</div>
<div>blat.exe -tf tolist.txt -cf cclist.txt -subject &#8220;Report %%B&#8221; -body &#8220;Here is the current report.&#8221; -server smtp.yourdomain.com -f <a href="mailto:sender@yourdomain.com">sender@yourdomain.com</a> -attach &#8220;\\server\share\%%B&#8221;</div>
<div>)</div>
<div>goto WRITELOG</div>
<div> </div>
<div>:ZEROFILES</div>
<div>echo %date% %time%  problem with retrieving number of current files &gt;&gt; ReportLog.txt</div>
<div>blat.exe -tf problist.txt -subject &#8220;Problem with Hold Report&#8221; -body &#8220;Problem emailing the current hold report.&#8221; -server smtp.yourdomain.com -f <a href="mailto:sender@yourdomain.com">sender@yourdomain.com</a></div>
<div> </div>
<div>:WRITELOG</div>
<div>REM format ReportLog.txt</div>
<div>echo %date% %time% Ending Script &gt;&gt; ReportLog.txt</div>
<div> </div>
<div>****************************************************</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/2036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/2036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/2036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/2036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/2036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/2036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/2036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/2036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/2036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/2036/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=2036&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2009/11/16/script-to-find-and-email-files-in-a-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Howto: Disable a NIC when running Sysprep</title>
		<link>http://thebackroomtech.com/2009/11/04/howto-disable-a-nic-when-running-sysprep/</link>
		<comments>http://thebackroomtech.com/2009/11/04/howto-disable-a-nic-when-running-sysprep/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 15:25:07 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[Command0]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[GuiRunOnce]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[netsh]]></category>
		<category><![CDATA[NIC]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Sysprep]]></category>
		<category><![CDATA[sysprep.inf]]></category>

		<guid isPermaLink="false">http://thebackroomtech.com/?p=2029</guid>
		<description><![CDATA[Disabling a network card when running sysprepping a Windows machine is easy.  Two things need to happen: 
1.  Add the following command to the [GuiRunOnce] section of your sysprep.inf file
 
Command0=&#8221;C:\temp\disablenic.cmd&#8221;
 
2.  On the machine you are sysprepping, create a C:\temp\disablenic.cmd file that contains the following:
 
netsh interface set interface &#8220;Local Area Connection 2&#8243; DISABLED
 
Change the name of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=2029&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Disabling a network card when running sysprepping a Windows machine is easy.  Two things need to happen: </p>
<div>1.  Add the following command to the <em>[GuiRunOnce]</em> section of your <em>sysprep.inf</em> file</div>
<div> </div>
<div><em>Command0=&#8221;C:\temp\disablenic.cmd&#8221;</em></div>
<div> </div>
<div>2.  On the machine you are sysprepping, create a <em>C:\temp\disablenic.cmd</em> file that contains the following:</div>
<div> </div>
<div><em>netsh interface set interface &#8220;Local Area Connection 2&#8243; DISABLED</em></div>
<div> </div>
<div>Change the name of the interface you want disabled as needed.  To determine the names of all network interfaces on a system, run the following command:</div>
<div> </div>
<div><em>netsh interface show interface</em></div>
<div> </div>
<div>Proceed with syspreping as normal. When the machine boots up, the specified network interface(s) will be disabled.</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/2029/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=2029&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2009/11/04/howto-disable-a-nic-when-running-sysprep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Howto automatically change the CD-ROM drive letter after running sysprep</title>
		<link>http://thebackroomtech.com/2009/10/15/howto-automatically-change-the-cd-rom-drive-letter-after-running-sysprep/</link>
		<comments>http://thebackroomtech.com/2009/10/15/howto-automatically-change-the-cd-rom-drive-letter-after-running-sysprep/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 16:56:02 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[CD-ROM]]></category>
		<category><![CDATA[CDROM]]></category>
		<category><![CDATA[diskpart]]></category>
		<category><![CDATA[diskpart.exe]]></category>
		<category><![CDATA[drive letter]]></category>
		<category><![CDATA[DVD]]></category>
		<category><![CDATA[optical]]></category>
		<category><![CDATA[optical drive]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Sysprep]]></category>
		<category><![CDATA[sysprep.inf]]></category>

		<guid isPermaLink="false">http://thebackroomtech.com/?p=1990</guid>
		<description><![CDATA[I&#8217;m finalizing a Windows 2003 R2 build that will become our gold image, which will be the source of all new server deployments within our organization.  One challenge I had to overcome was getting the CD-ROM/DVD drive to be set to drive Z: after the syspreped image is cloned and booted.
Many people are familiar with changing drive [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1990&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m finalizing a Windows 2003 R2 build that will become our gold image, which will be the source of all new server deployments within our organization.  One challenge I had to overcome was getting the CD-ROM/DVD drive to be set to drive Z: after the syspreped image is cloned and booted.</p>
<p>Many people are familiar with changing drive letters within the Device Management tool aka <em>devmgmt.msc</em>.  I needed to automate this task so the CD-ROM drive, which shows up as drive D on my image after running sysprep, would be automatically set to drive Z.</p>
<p>To accomplish this, I needed three things:</p>
<ol>
<li>An entry in the <em>[GuiRunOnce]</em> section of my <strong>sysprep.inf</strong> file that calls a batch file after booting up the sysprep&#8217;ed image for the first time. </li>
<li>The batch file mentioned in step 1, <strong>changeletter.cmd</strong> runs <em>diskpart.exe</em>, with the parameters supplied in <strong>drives.txt</strong></li>
<li>The <strong>drives.txt</strong> file, which details the <em>diskpart.exe</em> commands that change the CD-ROM&#8217;s drive letter from drive D to drive Z.</li>
</ol>
<p>The applicable portion on my <strong>sysprep.inf</strong> file:</p>
<p><em>[GuiRunOnce]<br />
Command0=&#8221;C:\changeletter.cmd&#8221;</em></p>
<p>My <strong>changeletter.cmd</strong> file:</p>
<p><em>diskpart /s c:\drives.txt</em></p>
<p>My <strong>drives.txt</strong> file:</p>
<p><em>select disk 0<br />
select volume d<br />
assign letter z noerr</em></p>
<p>Put all these pieces together, and your CD/DVD drive should be changed to drive letter Z after booting up the sysprep&#8217;ed image.  Note that in the <em>[GuiRunOnce]</em> section of the <strong>sysprep.inf</strong> file, the part to the left of the equals sign is <em>Command0</em>, as is Command zero.  If you wanted to run additional scripts, the next would be <em>Command1</em>, followed by <em>Command2</em>, etc.</p>
<p>If you&#8217;re curious about <a href="http://technet.microsoft.com/en-us/library/cc766465(WS.10).aspx" target="_self">diskpart.exe</a>, check out the details on syntax in <a href="http://support.microsoft.com/kb/300415" target="_self">KB300415</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/1990/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/1990/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/1990/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/1990/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/1990/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/1990/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/1990/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/1990/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/1990/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/1990/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1990&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2009/10/15/howto-automatically-change-the-cd-rom-drive-letter-after-running-sysprep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Find Windows system uptime from the command line</title>
		<link>http://thebackroomtech.com/2009/09/01/find-windows-system-uptime-from-the-command-line/</link>
		<comments>http://thebackroomtech.com/2009/09/01/find-windows-system-uptime-from-the-command-line/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 16:43:29 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[up time]]></category>
		<category><![CDATA[uptime]]></category>
		<category><![CDATA[Windows 2003]]></category>
		<category><![CDATA[Windows 2008]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Windows Vista]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://thebackroomtech.com/?p=1948</guid>
		<description><![CDATA[Here&#8217;s a quick and easy way of checking how long a Windows server or workstation has been up, via the command line.  It pipes the results of Net Statistics Workstation into find.  Run the following from a command prompt:
net statistics workstation &#124; find /i &#8220;statistics since&#8221;
The results will look like
Statistics since 8/12/2009 11:08 PM
Which shows [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1948&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a quick and easy way of checking how long a Windows server or workstation has been up, via the command line.  It pipes the results of Net Statistics Workstation into find.  Run the following from a command prompt:</p>
<p><em>net statistics workstation | find /i &#8220;statistics since&#8221;</em></p>
<p>The results will look like</p>
<p><em>Statistics since 8/12/2009 11:08 PM</em></p>
<p>Which shows the machine has been up since 11:08pm on August 12, 2009.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/1948/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/1948/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/1948/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/1948/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/1948/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/1948/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/1948/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/1948/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/1948/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/1948/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1948&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2009/09/01/find-windows-system-uptime-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix: Userenv event 1521 and Userenv 1511 errors in Windows Server 2003 Application log</title>
		<link>http://thebackroomtech.com/2009/05/19/fix-userenv-event-1521-and-userenv-1511-errors-in-windows-server-2003-application-log/</link>
		<comments>http://thebackroomtech.com/2009/05/19/fix-userenv-event-1521-and-userenv-1511-errors-in-windows-server-2003-application-log/#comments</comments>
		<pubDate>Tue, 19 May 2009 11:36:57 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[Profile]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Userenv]]></category>
		<category><![CDATA[Windows 2003]]></category>

		<guid isPermaLink="false">http://thebackroomtech.com/?p=1745</guid>
		<description><![CDATA[The following events were listed in the Windows 2003 event log when one of our second level help desk staff connected to the server console via RDP:
Event 1521 Source Userenv 
Windows cannot locate the server copy of your roaming profile and is attempting to log you on with your local profile. Changes to the profile will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1745&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The following events were listed in the Windows 2003 event log when one of our second level help desk staff connected to the server console via RDP:</p>
<p><em>Event 1521 Source Userenv</em> </p>
<p><em>Windows cannot locate the server copy of your roaming profile and is attempting to log you on with your local profile. Changes to the profile will not be copied to the server when you logoff. Possible causes of this error include network problems or insufficient security rights. If this problem persists, contact your network administrator.   </em></p>
<div><em>DETAIL &#8211; The network name cannot be found.</em></div>
<div> </div>
<div><em>Event 1511 Source Userenv</em></div>
<div> </div>
<div><em>Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.</em></div>
<div> </div>
<div>The solution, as outlined in <a href="http://support.microsoft.com/kb/941339" target="_self">KB941339</a>, is to delete the SID entries for the source user account from the following registry subkey:</div>
<div> </div>
<div><em>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</em></div>
<div> </div>
<div>To determine the user&#8217;s SID, save the script found at</div>
<div><a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1203.mspx">http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1203.mspx</a></div>
<div>as a .vbs file.  </div>
<div> </div>
<div><em>strComputer = &#8220;.&#8221;</em></div>
<div><em>Set objWMIService = GetObject(&#8220;winmgmts:\\&#8221; &amp; strComputer &amp; &#8220;\root\cimv2&#8243;)</em></div>
<div><em>Set objAccount = objWMIService.Get _</em></div>
<div><em>    (&#8220;Win32_UserAccount.Name=&#8217;kenmyer&#8217;,Domain=&#8217;fabrikam&#8217;&#8221;)</em></div>
<div><em>Wscript.Echo objAccount.SID</em></div>
<div> </div>
<div>Change the <em>Win32_UserAccount.Name=&#8217;kenmyer&#8217;,Domain=&#8217;fabrikam</em></div>
<div> </div>
<div>from <em>kenmeyer</em> and <em>fabrikam</em> to the user account in question and your domain name.</div>
<p>I saved the script as getsid.vbs.  Open a command prompt, and execute the script using cscript:</p>
<div><em>cscript.exe getsid.vbs</em></div>
<p>The script will display the SID associated with the user account specified.  Delete this from:</p>
<div><em>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</em></div>
<p>to correct the Userenv errors.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/1745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/1745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/1745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/1745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/1745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/1745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/1745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/1745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/1745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/1745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1745&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2009/05/19/fix-userenv-event-1521-and-userenv-1511-errors-in-windows-server-2003-application-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Capturing Virtual Machine Blue Screens via Powershell</title>
		<link>http://thebackroomtech.com/2009/05/07/capturing-virtual-machine-blue-screens-via-powershell/</link>
		<comments>http://thebackroomtech.com/2009/05/07/capturing-virtual-machine-blue-screens-via-powershell/#comments</comments>
		<pubDate>Thu, 07 May 2009 18:27:56 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[script]]></category>
		<category><![CDATA[.ps1]]></category>
		<category><![CDATA[Blue Screen]]></category>
		<category><![CDATA[BSOD]]></category>
		<category><![CDATA[OCR]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[screen shot]]></category>
		<category><![CDATA[screeshot]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://thebackroomtech.com/?p=1720</guid>
		<description><![CDATA[Eric Sloof at ntpro.nl has a nice post on how to capture screen shots of virtual machine blue screens using Powershell.  You can find the code here.
He then incorporated a Powershell script from Carter Shanklin that pushes a screenshot through Microsoft Office Document Imaging Library (MODI), OCR software found in Office 2003+, to extract the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1720&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Eric Sloof at <a href="http://www.ntpro.nl/">ntpro.nl</a> has a <a href="http://www.ntpro.nl/blog/archives/1097-Big-Brother-Really-Is-Watching.html">nice post</a> on how to capture screen shots of virtual machine blue screens using Powershell.  You can find the code <a href="http://www.ntpro.nl/blog/uploads/Get-ScreenShot-Copy9.ps1">here</a>.</p>
<p>He then incorporated a Powershell script from <a href="http://www.twitter.com/cshanklin">Carter Shanklin</a> that pushes a screenshot through <a href="http://www.codeproject.com/KB/office/modi.aspx?fid=172151&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;fr=76&amp;select=1629759">Microsoft Office Document Imaging Library</a> <em>(MODI),</em> OCR software found in Office 2003+, to extract the text from the image.</p>
<p>Very nice. Definitely go <a href="http://www.ntpro.nl/blog/uploads/vmbsd.ps1">download his application</a>, the Virtual Machine Blue Screen Detector.  Detailed post <a href="http://www.ntpro.nl/blog/archives/1100-Virtual-Machine-Blue-Screen-detector.html">here</a>.</p>
<p>The final product, which reads out the BSOD can be found <a href="http://www.ntpro.nl/blog/uploads/vmbsd1.ps1">here</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/1720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/1720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/1720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/1720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/1720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/1720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/1720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/1720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/1720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/1720/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1720&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2009/05/07/capturing-virtual-machine-blue-screens-via-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix for ConsoleOne.exe error &#8211; The procedure entry point WpSUDataLength could not be located in the dynamic link library gwenv1.dll</title>
		<link>http://thebackroomtech.com/2008/11/18/fix-for-consoleoneexe-error-the-procedure-entry-point-wpsudatalength-could-not-be-located-in-the-dynamic-link-library-gwenv1dll/</link>
		<comments>http://thebackroomtech.com/2008/11/18/fix-for-consoleoneexe-error-the-procedure-entry-point-wpsudatalength-could-not-be-located-in-the-dynamic-link-library-gwenv1dll/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 15:02:46 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[Groupwise]]></category>
		<category><![CDATA[ConsoleOne]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[gwnenv1.dll]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[snapins]]></category>

		<guid isPermaLink="false">http://thebackroomtech.wordpress.com/?p=1206</guid>
		<description><![CDATA[Some of our administrators received the following messages when launching ConsoleOne 1.3.6f after updating to Groupwise version 7.0.3 snapins from version 6.5.5:
The procedure entry point WpSUDataLength could not be located in the dynamic link library gwenv1.dll.   
and
An error occuring during ConsoleOne Startup.  ERROR:  java.lang.UnsatisfiedLinkError: ititIDs

 
The fix was to  copy gwenv1.dll from the Groupwise 7.0.3 client&#8217;s software distribution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1206&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some of our administrators received the following messages when launching <!--StartFragment-->ConsoleOne 1.3.6f after updating to Groupwise version 7.0.3 snapins from version 6.5.5:</p>
<p><!--StartFragment--><em>The procedure entry point WpSUDataLength could not be located in the dynamic link library gwenv1.dll.  </em> </p>
<p>and</p>
<div><em>An error occuring during ConsoleOne Startup.  ERROR:  java.lang.UnsatisfiedLinkError: ititIDs</em></div>
<div><em></em></div>
<p> </p>
<div><!--StartFragment-->The fix was to  copy gwenv1.dll from the Groupwise 7.0.3 client&#8217;s software distribution directory&#8217;s \win32\system32 directory to the local administrator&#8217;s c:\novell\consoleone\1.2\bin directory.</div>
<div> </div>
<div>You must ensure gwenv1.dll file is version 7.0.3.  Also check c:\windows\system32 for existence of prior version of gwenv1.dll.</div>
<p> </p>
<div>You can <a href="http://thebackroomtech.com/2008/03/04/making-groupwise-7-and-blackberry-enterprise-server-communicate/" target="_blank">read about other gwenv1.dll issues I encountered</a> that deal with the Groupwise client and Blackberry Enterprise Server (BES).</div>
<div><em></em></div>
<p><!--StartFragment--></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/1206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/1206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/1206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/1206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/1206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/1206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/1206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/1206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/1206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/1206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1206&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2008/11/18/fix-for-consoleoneexe-error-the-procedure-entry-point-wpsudatalength-could-not-be-located-in-the-dynamic-link-library-gwenv1dll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>.cmd script that determines if a directory is empty and sends email notification of status</title>
		<link>http://thebackroomtech.com/2008/11/05/cmd-script-that-determines-if-a-directory-is-empty-and-sends-email-notification-of-status/</link>
		<comments>http://thebackroomtech.com/2008/11/05/cmd-script-that-determines-if-a-directory-is-empty-and-sends-email-notification-of-status/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 15:57:01 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[script]]></category>
		<category><![CDATA[.cmd]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[V-mailer]]></category>
		<category><![CDATA[vmailer]]></category>

		<guid isPermaLink="false">http://thebackroomtech.wordpress.com/?p=1161</guid>
		<description><![CDATA[I have an email archiving application on a Windows 2003 server that requires a lot more manual intervention than I prefer.  As the application moves the mail messages throughout it&#8217;s various directory queues, sometimes it experiences an event that causes processing to halt.  This results in a particular directory filling up until an administrator manually [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1161&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><!--StartFragment-->I have an email archiving application on a Windows 2003 server that requires a lot more manual intervention than I prefer.  As the application moves the mail messages throughout it&#8217;s various directory queues, sometimes it experiences an event that causes processing to halt.  This results in a particular directory filling up until an administrator manually clears out the queues.  The last time this happened we had 75,000 files, 10GB worth of messages we had to remove and recover by hand.</p>
<div>This server is only monitored by SolarWinds, which has the ability to monitor a volume, by not a particular directory.  In the past the only time we knew there was a problem was when the volume filled up with backlogged messages.</div>
<div> </div>
<div>I decided to implement a system that would periodically poll the queue directory and would send email notifications that the queue was empty, or that files were backlogged.  Because of our strict change control procedures I am unable to load any freeware monitoring solutions, so I needed to create my own via scripts.  Luckily <a href="http://virdi-software.com/vmailer">V-Mailer</a>, a freeware SMTP batch mailer is already approved for usage on our internal network, so I was able to utilize this software.</div>
<div> </div>
<div>The script shown below, <em>chksize.cmd</em>, utilizes the built in DIR command to determine if the server&#8217;s e:\msw\internet\pending directory is empty.  </div>
<pre class="brush: xml;">
REM delete existing mailarch1file.txt file
if exist mailarch1file.txt del mailarch1file.txt

REM determine if files are queued using dir and output results to mailarch1file.txt
e:\msw\internet\pending /A-D /B  mailarch1file.txt

REM If mailarch1file.txt is empty (EQU 0), files are not queued
For %%R in (mailarch1file.txt) do if %%~zR EQU 0 goto nofiles

REM delete existing results.txt file if exist results.txt del results.txt
REM combine message file mailarch1fail.txt with results of mailarch1file.txt into results.txt
copy /B mailarch1fail.txt + mailarch1file.txt results.txt

REM email notification that files are queued in directory e:\msw\internet\pending
REM notification to technical support using vmailer.exe that mailarch1 may be failing
vmailer.exe results.txt 172.17.61.83 mailadmin@domain.corp mailarch1@domain.corp
goto exitscript

:nofiles
REM email notification no files are queued in directory
REM notification to technical support using vmailer.exe that mailarch1 is okay
vmailer.exe mailarch1isok.txt 172.17.61.83 mailadmin@domain.corp mailarch1@domain.corp

:exitscript
REM exit script
exit
</pre>
<p><!--StartFragment-->If the<em> DIR</em> command&#8217;s output file <em>mailarch1file.txt</em> is empty, a notification text file <em>mailarchisok.txt</em> is emailed to myself that states the server is okay.   </p>
<div>If the output file is not empty, the results of <em>mailarch1file.txt</em> is concatenated with a text file <em>mailarchfail.txt</em> that states the server may be failing.  Because V-Mailer does not really handle attachments, I have to combine the results text file with the notification text file into <em>results.txt</em>, which is an ugly but effective method.</div>
<div>Here is my <em>mailarch1fail.txt</em> file, which is pre-formatted for use with V-Mailer</div>
<pre class="brush: xml;">
To: mailadmin@domain.corp
From: mailarch1@domain.corp
Subject: mailarch1 may be failing

mailarch1 DOES have messages queued in the E:\MSW\Internet\PENDING directory
</pre>
<div>Here is my <em>mailarch1isok.txt</em> file, which is pre-formatted for use with V-Mailer</div>
<div>
<pre class="brush: xml;">
To: mailadmin@domain.corp
From: mailarch1@domain.corp
Subject: mailarch1 is okay

mailarch1 DOES NOT have messages queued in the E:\MSW\Internet\PENDING directory
</pre>
</div>
<div><!--StartFragment--><br />
Finally, I used the Windows <em>schtasks</em> command line utiliy to run c:\chksize.cmd daily at 4pm.  The task, named chksize4pm runs as as the service@domain.corp user with a password of 3rv1c3. <br />
This is a single command that may have wrapped in your browser.</div>
<div>
<div>
<pre class="brush: xml;">
schtasks /create /S \\mailarch1 /U service@domain.corp /P $3rv1c3 /SC Daily /TN chksize4pm /TR c:\chksize.cmd /ST 16:00
</pre>
</div>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/1161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/1161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/1161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/1161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/1161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/1161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/1161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/1161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/1161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/1161/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=1161&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2008/11/05/cmd-script-that-determines-if-a-directory-is-empty-and-sends-email-notification-of-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to backup Groupwise configuration files on Netware Part I</title>
		<link>http://thebackroomtech.com/2008/09/15/script-to-backup-groupwise-configuration-files-on-netware-part-i/</link>
		<comments>http://thebackroomtech.com/2008/09/15/script-to-backup-groupwise-configuration-files-on-netware-part-i/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 13:05:24 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[Groupwise]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Netware]]></category>

		<guid isPermaLink="false">http://thebackroomtech.wordpress.com/?p=882</guid>
		<description><![CDATA[I performed a Groupwise 6.5 to 7.0.3 upgrade this weekend on the domain and post office servers, and wrote a quick script to backup the agent configuration files.  It&#8217;s not a pretty script, but I wrote it in about 10 minutes and it worked on all my Netware servers.  I call this script part I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=882&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I performed a Groupwise 6.5 to 7.0.3 upgrade this weekend on the domain and post office servers, and wrote a quick script to backup the agent configuration files.  It&#8217;s not a pretty script, but I wrote it in about 10 minutes and it worked on all my Netware servers.  I call this script part I since it only deals with files affected by my upgrade, which are all located on the sys volume.  I upgrade the gateways in two weeks, so I&#8217;ll backup the configuration files in the domain directories then.</p>
<p>You need to set SERVERNAME, SERVERVOL, BKUPLOC and BKUPDIR. If I&#8217;ve missed any files, please let me know and I&#8217;ll add them to the list.</p>
<p><!--StartFragment--></p>
<pre class="brush: cpp;">
@echo off
REM script to backup Groupwise configuration files from Netware server
REM replace SERVERNAME with the name of your Netware/Groupwise server
SET SERVERNAME=\\grpwise4
SET SYSVOL=sys
REM replace SERVERVOL with the name of the volume to write the backup files to
SET SERVERVOL=vol1
REM SERVERPATH is combination of server and volume name in \\server\vol\ format
SET SERVERPATH=%SERVERNAME%\%SERVERVOL%
REM SYSVOLPATH is combination of server and volume name in \\server\sys\ format
SET SYSVOLPATH=%SERVERNAME%\%SYSVOL%
REM APACHEAPTH is sys:\apache2 Apache2 web server directory
SET APACHEPATH=%SERVERNAME%\%SYSVOL%\Apache2
REM NOVELLPATH is sys:\novell directory
SET NOVELLPATH=%SERVERNAME%\%SYSVOL%\Novell
REM TOMCATPATH is sys:\tomcat\4 directory
SET TOMCATPATH=%SERVERNAME%\%SYSVOL%\tomcat\4
REM BKUPLOC is the directory to save backup files to
REM this script has no error checking, so the directory's existance will probably matter
SET BKUPLOC=gw65bkup
REM BKUPDIR is the full path to the backup directory
SET BKUPDIR=%serverpath%\%bkuploc%
REM Create the backup directory
md %bkupdir%
REM copy sys:\system\ config files
md %bkupdir%\system
copy %sysvolpath%\system\*.mta %bkupdir%\system
copy %sysvolpath%\system\*.poa %bkupdir%\system
copy %sysvolpath%\system\*.waa %bkupdir%\system
copy %sysvolpath%\system\*.cfg %bkupdir%\system
copy %sysvolpath%\system\*.ncf %bkupdir%\system
copy %sysvolpath%\system\*.xml %bkupdir%\system
copy %sysvolpath%\system\*.bin %bkupdir%\system
copy %sysvolpath%\system\autoexec.ncf %bkupdir%\system
REM copy important Apache files
md %bkupdir%\apache2\conf
copy %apachepath%\conf\*.* %bkupdir%\apache2\conf
REM copy important Tomcat files
md %bkupdir%\tomcat\4\conf
copy %tomcatpath%\conf\*.* %bkupdir%\tomcat\4\conf
REM copy important Webaccess files
md %bkupdir%\novell\webaccess\conf
copy %novellpath%\webaccess\*.* %bkupdir%\novell\webaccess
REM copy important Groupwise NLMs from sys:\system
copy %sysvolpath%\system\dbcopy.nlm %bkupdir%\system
copy %sysvolpath%\system\ex*.nlm %bkupdir%\system
copy %sysvolpath%\system\gw*.nlm %bkupdir%\system
copy %sysvolpath%\system\ldap*.nlm %bkupdir%\system
copy %sysvolpath%\system\tsa*.nlm %bkupdir%\system
copy %sysvolpath%\system\scc*.nlm %bkupdir%\system
copy %sysvolpath%\system\vs*.nlm %bkupdir%\system
copy %sysvolpath%\system\wvc*.nlm %bkupdir%\system
copy %sysvolpath%\system\xg*.nlm %bkupdir%\system
</pre>
<div>Save the script as gwbkup1.bat and run it from your Windows workstation.</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/thebackroomtech.wordpress.com/882/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/thebackroomtech.wordpress.com/882/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/882/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=882&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2008/09/15/script-to-backup-groupwise-configuration-files-on-netware-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple script to backup Groupwise 7 configuration files on SLES Linux</title>
		<link>http://thebackroomtech.com/2008/09/08/simple-script-to-backup-groupwise-7-configuration-files-on-sles-linux/</link>
		<comments>http://thebackroomtech.com/2008/09/08/simple-script-to-backup-groupwise-7-configuration-files-on-sles-linux/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 12:25:55 +0000</pubDate>
		<dc:creator>Julie</dc:creator>
				<category><![CDATA[Groupwise]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[.sh]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Sles]]></category>

		<guid isPermaLink="false">http://thebackroomtech.wordpress.com/?p=807</guid>
		<description><![CDATA[I&#8217;m about to upgrade our Groupwise infrastructure, and I wanted to write a simple script that would backup and archive important Groupwise configuration files.  I&#8217;m not proficient at scripting, but here&#8217;s what I came up with.  Please recommend additional files to include if I have overlooked anything.

####################################
### Begin gwbkup.sh
### script to backup Groupwise configuration files
### /home/backups/gw7cfg is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=807&subd=thebackroomtech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m about to upgrade our Groupwise infrastructure, and I wanted to write a simple script that would backup and archive important Groupwise configuration files.  I&#8217;m not proficient at scripting, but here&#8217;s what I came up with.  Please recommend additional files to include if I have overlooked anything.</p>
<pre class="brush: cpp;">
####################################
### Begin gwbkup.sh
### script to backup Groupwise configuration files
### /home/backups/gw7cfg is the directory to backup files to
### backup Groupwise agent configuration files
cp /opt/novell/groupwise/agents/share/* /home/backups/gw7cfg/
cp /etc/opt/novell/groupwise/gwha.conf /home/backups/gw7cfg/
### backup Apache web server configuration files
cp /etc/apache2/httpd.conf /home/backups/gw7cfg/
cp /etc/apache2/conf.d/gw* /home/backups/gw7cfg/
### Backup WebAccess configuration files
cp /opt/novell/groupwise/webaccess/webacc.cfg /home/backups/gw7cfg/
cp /opt/novell/groupwise/webaccess/commgr.cfg /home/backups/gw7cfg/commgr.cfg.webacc
cp /opt/novell/groupwise/webaccess/spellchk.cfg /home/backups/gw7cfg/
### Backup WebPublisher configuration files
cp /opt/novell/groupwise/webpublisher/webpub.cfg /home/backups/gw7cfg/
cp /opt/novell/groupwise/webpublisher/commgr.cfg /home/backups/gw7cfg/commgr.cfg.webpub
cp /opt/novell/groupwise/webaccess/ldap.cfg /home/backups/gw7cfg/
### Backup Tomcat configuration files
cp -r /etc/tomcat5/base/* /home/backups/gw7cfg/
### backup gwia files specific to each gateway
### may have more than one gwia per Groupwise system, so append gateway
### name to end of file
cp /mail/gwiado/wpgate/gwia703/exepath.cfg /home/backups/gw7cfg/exepath.cfg.gwia703
cp /mail/gwiado/wpgate/gwia703/gwac.db /home/backups/gw7cfg/gwac.db.gwia703
cp /mail/gwiado/wpgate/gwia703/gwauth.cfg /home/backups/gw7cfg/gwauth.cfg.gwia703
cp /mail/gwiado/wpgate/gwia703/mimetype.cfg /home/backups/gw7cfg/mimetype.cfg.gwia703
### backup webaccess files specific to each gateway
### may have more than one gwia per Groupwise system, so append gateway
### name to end of file
cp /mail/webdo/wpgate/webac703/comint.cfg /home/backups/gw7cfg/comint.cfg.webac703
cp /mail/webdo/wpgate/webac703/commgr.cfg /home/backups/gw7cfg/commgr.cfg.webac703
cp /mail/webdo/wpgate/webac703/gwac.db /home/backups/gw7cfg/gwac.db.webac703
cp /mail/webdo/wpgate/webac703/mimetype.cfg /home/backups/gw7cfg/mimetype.cfg.webac703

### Backup Groupwise monitor files
cp /opt/novell/groupwise/gwmonitor/gwmonitor.cfg /home/backups/gw7cfg/gwmonitor.cfg
cp /opt/novell/groupwise/gwmonitor/default/gwmonitor.cfg /home/backups/gw7cfg/gwmonitor.cfg.default
cp /opt/novell/groupwise/gwmonitor/default/gwmonitor.xml /home/backups/gw7cfg/gwmonitor.xml
### tar configuration files and label archive with today's date
tar -pcvzf /home/backups/$(date +%m-%d-%Y).tar.gz /home/backups/gw7cfg/
### Remove old configuration files rm -r /home/backups/gw7cfg/* 
### End gwbkup.sh ####################################
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/thebackroomtech.wordpress.com/807/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/thebackroomtech.wordpress.com/807/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thebackroomtech.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thebackroomtech.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thebackroomtech.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thebackroomtech.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thebackroomtech.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thebackroomtech.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thebackroomtech.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thebackroomtech.wordpress.com/807/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thebackroomtech.wordpress.com/807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thebackroomtech.wordpress.com/807/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thebackroomtech.com&blog=1120206&post=807&subd=thebackroomtech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://thebackroomtech.com/2008/09/08/simple-script-to-backup-groupwise-7-configuration-files-on-sles-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc45e50eb9d841ff9cf17d75fe766df7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Julie</media:title>
		</media:content>
	</item>
	</channel>
</rss>