<?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; Scripting</title>
	<atom:link href="http://andrewmorgan.ie/tag/scripting/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>Enabling disk caches from a script</title>
		<link>http://andrewmorgan.ie/2009/11/enabling-disk-caches-from-a-script/</link>
		<comments>http://andrewmorgan.ie/2009/11/enabling-disk-caches-from-a-script/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 10:05:16 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Server 2003]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=271</guid>
		<description><![CDATA[Just a quick post to share a fundamental performance increase to any citrix server out there running on local disk. If your disk supports caching, enable it now! Get a copy of dskcache.exe from here: run the following command: dskcache.exe +w +p Enjoy your new disk performance!]]></description>
				<content:encoded><![CDATA[<p><img class="alignright" src="/wp-content/uploads/2008/10/1010451006.jpg?w=105&amp;h=105" alt="" width="105" height="105" />Just a quick post to share a fundamental performance increase to any citrix server out there running on local disk. If your disk supports caching, enable it now!</p>
<p>Get a copy of dskcache.exe from <a href="http://support.microsoft.com/default.aspx/kb/811392" target="_blank">here</a>:</p>
<p>run the following command: <strong>dskcache.exe +w +p</strong></p>
<p>Enjoy your new disk performance!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2009/11/enabling-disk-caches-from-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing a printer online using a script:</title>
		<link>http://andrewmorgan.ie/2009/06/forcing-a-printer-online-using-a-script/</link>
		<comments>http://andrewmorgan.ie/2009/06/forcing-a-printer-online-using-a-script/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 07:53:38 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Printing]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VB Scripting]]></category>
		<category><![CDATA[Printers]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=253</guid>
		<description><![CDATA[Recently while installing Zetafax 11, we noticed that some of our maintenance scripts on our XenApp servers were causing the zetafax printer to fall offline on reboot. Below is a simple to use (built in to server 2003) script that can be used to force a printer online. The Following will force &#8220;Printer Name&#8221; to work online: cscript C:WINDOWSsystem32prncnfg.vbs -t -p &#8220;Printer Name&#8221; -workoffline As an extra function, the below will rename a local printer: Cscript %windir%system32Prncnfg.vbs -x -p &#8220;old [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-254" title="printer_icon" src="/wp-content/uploads/2009/06/printer_icon.jpg" alt="printer_icon" width="99" height="99" />Recently while installing Zetafax 11, we noticed that some of our maintenance scripts on our XenApp servers were causing the zetafax printer to fall offline on reboot. Below is a simple to use (built in to server 2003) script that can be used to force a printer online.</p>
<p>The Following will force &#8220;Printer Name&#8221; to work online:</p>
<p>cscript C:WINDOWSsystem32prncnfg.vbs -t -p &#8220;Printer Name&#8221; -workoffline</p>
<p>As an extra function, the below will rename a local printer:</p>
<p>Cscript %windir%system32Prncnfg.vbs -x -p &#8220;old printer name&#8221; -z newprintername</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2009/06/forcing-a-printer-online-using-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Igel Database command mistake.</title>
		<link>http://andrewmorgan.ie/2008/11/igel-database-command-mistake/</link>
		<comments>http://andrewmorgan.ie/2008/11/igel-database-command-mistake/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 11:03:17 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Igel]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=173</guid>
		<description><![CDATA[Despite Igels better judgement, the command they have published in their documentation to create an SQL database does not work. The command itself can be found here. The actual working command is listed below, thanks to J Booker in Igel for the help. CREATE DATABASE rmlogin GO USE rmlogin GO CREATE LOGIN rmlogin with PASSWORD = &#8216;Passw0rd&#8217; GO CREATE USER rmlogin with DEFAULT_SCHEMA = rmlogin GO CREATE SCHEMA rmlogin AUTHORIZATION rmlogin GRANT CONTROL to rmlogin GO]]></description>
				<content:encoded><![CDATA[<p><img class="alignright wp-image-934 size-full" title="igel_logo" src="http://andrewmorgan.ie/wp-content/uploads/2011/10/igel_logo.jpg" alt="" width="135" height="135" />Despite Igels better judgement, the command they have published in their documentation to create an SQL database does not work. The command itself can be found <a href="http://www.download-igel.com/ftp/manuals/english/remote_manager/IGEL%20Remote%20Manager%203.0%20Installation%20Guide.pdf" target="_blank">here</a>.</p>
<p>The actual working command is listed below, thanks to J Booker in Igel for the help.</p>
<p style="padding-left: 30px;">CREATE DATABASE rmlogin<br />
GO<br />
USE rmlogin<br />
GO<br />
CREATE LOGIN rmlogin with PASSWORD = &#8216;Passw0rd&#8217;<br />
GO<br />
CREATE USER rmlogin with DEFAULT_SCHEMA = rmlogin<br />
GO<br />
CREATE SCHEMA rmlogin AUTHORIZATION rmlogin<br />
GRANT CONTROL to rmlogin<br />
GO</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/11/igel-database-command-mistake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unattended install of AppV Lightweight streaming server</title>
		<link>http://andrewmorgan.ie/2008/11/unattended-install-of-appv-lightweight-streaming-server/</link>
		<comments>http://andrewmorgan.ie/2008/11/unattended-install-of-appv-lightweight-streaming-server/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 19:34:47 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[App-V]]></category>
		<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Appv]]></category>
		<category><![CDATA[Enteo]]></category>
		<category><![CDATA[Softgrid]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=168</guid>
		<description><![CDATA[I set about rolling out appv light weight streaming server recently, its the new version of app that requires no database, management server, console&#8230; nothing! Great application but the unattended install lacked documentation etc. Below is the script i used to install the lightweight server via the command line, the %appv-dir% variable should be a network share or local drive that the server will access for the applications: set appv-dir=servernameappv-production$ msiexec /i setup.msi INSTALLDIR=&#8221;C:Program FilesMicrosoft System Center App Virt Streaming [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2008/11/softgrid_banner_left1.jpg"><img class="size-full wp-image-171 alignright" title="softgrid_banner_left1" src="/wp-content/uploads/2008/11/softgrid_banner_left1.jpg" alt="" width="71" height="62" /></a>I set about rolling out appv light weight streaming server recently, its the new version of app that requires no database, management server, console&#8230; nothing! Great application but the unattended install lacked documentation etc.</p>
<p>Below is the script i used to install the lightweight server via the command line, the %appv-dir% variable should be a network share or local drive that the server will access for the applications:</p>
<p style="padding-left:30px;">set appv-dir=servernameappv-production$<br />
msiexec /i setup.msi INSTALLDIR=&#8221;C:Program FilesMicrosoft System Center App Virt Streaming Server&#8221; ADDLOCAL=Release_SoftGrid_Lightweight_Server SWICONTENTDIR=%appv-dir% /Lv &#8220;c:appv-install.log&#8221; /qn /norestart</p>
<p>Hope it speeds up somebody elses install somewhat <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/11/unattended-install-of-appv-lightweight-streaming-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enteo: What the hell is a mscreate.dir folder?</title>
		<link>http://andrewmorgan.ie/2008/10/enteo-what-the-hell-is-a-mscreatedir-folder/</link>
		<comments>http://andrewmorgan.ie/2008/10/enteo-what-the-hell-is-a-mscreatedir-folder/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 21:06:10 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Enteo]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=145</guid>
		<description><![CDATA[We are using Enteo as a deployment method for our new citrix farms at present, we are having one or two bugs but over all I&#8217;m greatly impressed with this software, its like RIS but it very functional! Our latest issue with powerfuse is that we cant redirect the users desktop, we have the home drive mapped, the user shell registry entries but poof, no desktop redirection. During troubleshooting we noticed these mscreate.dir folders in every single folder in our [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2008/10/zeichen_typ_data_22.gif"><img class="alignright size-full wp-image-146" title="zeichen_typ_data_22" src="/wp-content/uploads/2008/10/zeichen_typ_data_22.gif" alt="" width="32" height="32" /></a></p>
<p>We are using Enteo as a deployment method for our new citrix farms at present, we are having one or two bugs but over all I&#8217;m greatly impressed with this software, its like RIS but it very functional!</p>
<p>Our latest issue with powerfuse is that we cant redirect the users desktop, we have the home drive mapped, the user shell registry entries but poof, no desktop redirection.</p>
<p>During troubleshooting we noticed these mscreate.dir folders in every single folder in our mandatory profile folder and havent a clue where they came from?!? After a bit of digging around Enteo creates these files as logs for the uninstallation of software deployed through Enteo. We were using an Enteo script to copy the mandatory profile to the %systemdrive% of every citrix server allowing the manadatory profile to be loaded quickly from local disk.</p>
<p>Now that we know what the folders are we dont mind them too much, but if you do choose to remove them, simply open the folder you have copied down with enteo and execute this batch command to remove them:</p>
<p style="padding-left:30px;">del /s /f mscreate.dir</p>
<p>Nothing else to report at the moment, well lots to report but not enough time <img src="http://andrewmorgan.ie/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
<p>Toodles.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/10/enteo-what-the-hell-is-a-mscreatedir-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install server 2003 r2 disk 2 Silently.</title>
		<link>http://andrewmorgan.ie/2008/10/how-to-install-server-2003-r2-disk-2-silently/</link>
		<comments>http://andrewmorgan.ie/2008/10/how-to-install-server-2003-r2-disk-2-silently/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 14:08:52 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Enteo]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Server 2003]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=148</guid>
		<description><![CDATA[During out Enteo rollout we were faced with a problem of how to either A: stop server 2003 from prompting us to install cd or B: just install the useless cd to register the operating system as R2. After a bit of digging, and some help from a very friendly consultant called Hans from Frontrange, we came up with the following method. You need to create a .CAB file of the entire cd of r2, extract it using extract.exe to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2008/10/1010451006.jpg"><img class="alignright size-full wp-image-149" title="1010451006" src="/wp-content/uploads/2008/10/1010451006.jpg" alt="" width="105" height="105" /></a>During out Enteo rollout we were faced with a problem of how to either A: stop server 2003 from prompting us to install cd or B: just install the useless cd to register the operating system as R2. After a bit of digging, and some help from a very friendly consultant called Hans from Frontrange, we came up with the following method.</p>
<p>You need to create a .CAB file of the entire cd of r2, extract it using <a href="http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=7eea40f3-21be-4f77-921c-3cf7042d6eb2&amp;displaylang=en" target="_blank">extract.exe</a> to the root of the c drive, run the installation then delete the extracted files (if you wish).</p>
<p>Sounds simple eh? you have no idea how much of a pain in the backside this was. Firstly ill put this out there for anyone who tries to use the CRAPPY utilities by microsoft for creating cab files, DONT BOTHER. After 2 hours of tinkering and scripting the steaming pile of useless cab files was quite proportionate.</p>
<p>To answer this question to anyone googling, here it is:<strong> </strong></p>
<p><strong>How do i create a cab file from a source folder? Use <a href="http://www.tugzip.com/">tugzip</a>.</strong> One problem with tugzip and cabs its seems to hang on 100% with the only option to cancel, this seems to be normal, so just wait for 2-3 mins on 100% then cancel away.</p>
<p>The only problem here is that if you have the files above the c: prompt the files will not install correctly, tugzip remembers the path of the zipped files after the drive prompt, so if you zipped c:mydocs2003r2 extract will put them back in that exact folder.</p>
<p>Heres what you do:</p>
<ul>
<li>copy your installation files to a folder anywhere on your disk.</li>
<li>use the subst command to map the folder to the root of a free drive (subst z: c:mydocs2003r2)</li>
<li>now browse to the z: drive and use tugzip to create your archive file.</li>
</ul>
<p><em>you can of course bypass all the above if you place the cd in the drive and use the cd&#8217;s drive letter <img src="http://andrewmorgan.ie/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /> its amazing how simple an answer that WOULD have been if i had thought of it.</em></p>
<p>Once you have done that, its simple scripting time!</p>
<p style="padding-left:30px;">copy servernamesharenameextract.exe c:<br />
copy servernamesharename2003r2cd2.cab c:<br />
c:extract.exe /E 2003R2CD2.cab /L c:2003R2CD2 /y<br />
C:2003R2CD2CMPNENTSR2setup2.exe /q /a /p:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /sr<br />
rd c:2003R2CD2 /s /q<br />
del extract.exe<br />
del 2003R2CD2.cab</p>
<p>TADA <img src="http://andrewmorgan.ie/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /></p>
<p>your server (post reboot) should report server 2003 r2 correctly. Might be worth noting that server 2003 enterprise and standard do NOT share the same cd. So if you have an environment with both, time to repeat the above steps for the other cd.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/10/how-to-install-server-2003-r2-disk-2-silently/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ntbackup part: 3 Rolling out the job.</title>
		<link>http://andrewmorgan.ie/2008/08/ntbackup-part3-rolling-out-the-job/</link>
		<comments>http://andrewmorgan.ie/2008/08/ntbackup-part3-rolling-out-the-job/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 07:41:56 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NT Backup]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Ntbackup]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=102</guid>
		<description><![CDATA[In the previous two articles I have covered off how to backup your servers to one file share and script a scheduled task to automate the process. Now what we have to do is copy the backup.bat out to each C: drive of every server, and create our scheduled task on each server. There are many reasons I have decided to do this process manually. Leaving the backup.bat on the c: drive will allow for easy maintenance of the backups [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.teamapproach.ca/trouble/images/ntbackup.jpg"><img class="alignright" src="http://www.teamapproach.ca/trouble/images/ntbackup.jpg" alt="" width="52" height="51" /></a><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--></p>
<p class="MsoNormal">In the previous two articles I have covered off how to backup your servers to one file share and script a scheduled task to automate the process. Now what we have to do is copy the backup.bat out to each C: drive of every server, and create our scheduled task on each server.</p>
<p class="MsoNormal">There are many reasons I have decided to do this process manually. Leaving the backup.bat on the c: drive will allow for easy maintenance of the backups on each server for adding/removing backups. The second reason is the servers you wish to backup will need different drives backed up!</p>
<p class="MsoNormal">Once you have copied the custom backup.bat to the c drive of all your servers its now time to schedule the task…this is a simple and painless script that can also be reverse engineered to delete the job.</p>
<p class="MsoNormal">Place all your server names in a text file called servers.txt one per line and place it to the c: drive root e.g. c:. Once created, kick off a CMD prompt as a user with admin rights on the servers.</p>
<p class="MsoNormal">Now using the for command:</p>
<p class="MsoNormal" style="padding-left:30px;">FOR /F &#8220;tokens=* delims=: &#8221; %%i in (c:servers.txt) do schtasks /create /s %%i /u domainusername /p password /tn Server-Backup /tr “c:backup.bat” /sc daily /st 19:00:00</p>
<p class="MsoNormal">This will contact each server, one by one, and create your schedueled task to run every day at 7pm. Make sure to change the domain username and password to match your own environment.</p>
<p>Agus sin é.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/08/ntbackup-part3-rolling-out-the-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NtBackup Part:2 schedueling a task via cmd.</title>
		<link>http://andrewmorgan.ie/2008/08/nt-backup-part2-adding-a-schedueled-task-via-cmd/</link>
		<comments>http://andrewmorgan.ie/2008/08/nt-backup-part2-adding-a-schedueled-task-via-cmd/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 09:43:13 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NT Backup]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Ntbackup]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=83</guid>
		<description><![CDATA[As part of an ntbackup script i began recently, I needed to look at how to schedule tasks from remotely. I had some experience using at.exe but seeing as schtasks seems to be the new tool i decided to give it a lash. Almost immediately i ran into problems, if i was to specify a username and password for the job to run as, the script demanded a system name&#8230; why ask for a system name if you want to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright" src="http://www.teamapproach.ca/trouble/images/ntbackup.jpg" alt="" width="52" height="51" />As part of an ntbackup script i began recently, I needed to look at how to schedule tasks from remotely. I had some experience using at.exe but seeing as schtasks seems to be the new tool i decided to give it a lash.</p>
<p>Almost immediately i ran into problems, if i was to specify a username and password for the job to run as, the script demanded a system name&#8230; why ask for a system name if you want to run it locally i wondered, but with using the %computername% variable it allowed me to run this locally.</p>
<p>schtasks /create /s %computername% /u domainusername /p Password /tn Server-Backup /tr &#8220;c:backup.bat&#8221; /sc daily /st 09:00:00</p>
<p>the above schedules backup.bat to run as whatever user you specify, it will display as &#8220;Server-Backup&#8221; in scheduled tasks and will run daily for ever.</p>
<p>Below is an example of what you should see in scheduled tasks:</p>
<p><a href="/wp-content/uploads/2008/08/schtask2.jpg"><img class="alignnone size-full wp-image-99" src="/wp-content/uploads/2008/08/schtask2.jpg" alt="" width="495" height="134" /></a></p>
<p>Check the next post for information on how to roll this out to multiple servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/08/nt-backup-part2-adding-a-schedueled-task-via-cmd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ntbackup Part 1: Scripting Nt backup</title>
		<link>http://andrewmorgan.ie/2008/08/ntbackup-part-1-scripting-nt-backup/</link>
		<comments>http://andrewmorgan.ie/2008/08/ntbackup-part-1-scripting-nt-backup/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 06:57:53 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NT Backup]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Ntbackup]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=88</guid>
		<description><![CDATA[With the cost of newer backup software being very pricey to the small organization, its a wonder that the beautifully simple solution that is NTbackup has been overlooked so many times! Nt backup isn&#8217;t pretty, it can be a little temperamental and requires you to keep on top of it at all times&#8230; but so is every other product on the market. I have chosen to keep a network location for all the backups you will create for your servers, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.teamapproach.ca/trouble/images/ntbackup.jpg"><img class="alignright" src="http://www.teamapproach.ca/trouble/images/ntbackup.jpg" alt="" width="52" height="51" /></a>With the cost of newer backup software being very pricey to the small organization, its a wonder that the beautifully simple solution that is NTbackup has been overlooked so many times!</p>
<p>Nt backup isn&#8217;t pretty, it can be a little temperamental and requires you to keep on top of it at all times&#8230; but so is every other product on the market.</p>
<p>I have chosen to keep a network location for all the backups you will create for your servers, this will aid in organizing log files, and backing up each daily backup from one resource. There are so many options available, with incremental s, dailies, full and shadow copies i have decided to keep it simple with full backups daily, but once you have an idea of how the script works theres nothing stopping you from configuring it to suit yourself.</p>
<p>To kick off the guts of this three parter I&#8217;ll start with writing the script you will need to backup your infrastructure to a single disk space.</p>
<p><span id="more-88"></span></p>
<p>Well to begin, lets start with some simple variables:</p>
<p style="padding-left:30px;">set logfiledir=&#8221;%userprofile%Local SettingsApplication DataMicrosoftwindows ntNTBackupdata&#8221;<br />
set logdest=ient1dfs002j$backupslogs<br />
set backdes=ient1dfs002j$backups</p>
<p style="padding-left:30px;">FOR /F &#8220;usebackq tokens=1-4 delims=/ &#8221; %%d IN (`date /t`) DO set cdate=%%d%%e%%f<br />
FOR /F &#8220;usebackq tokens=1,2 delims=: &#8221; %%t IN (`time /t`) do set ctime=%%t%%u<br />
del /q %logfiledir%*.log</p>
<p>well with the above, i am specifying that the %logfiledir% is where ntbackup saves its log files. i will use this var to copy the log files out and have them available for a quick &#8220;once a day&#8221; review to make sure the backups ran. %logdest% &amp; %backdes% are variables for defining where you are going to store your log files, and backup files respectively.</p>
<p>The two For commands are used to create a cdate and ctime variable for the current date and time, we will use this to rename the files later on in the script.</p>
<p>the del statement simply cleans up the log file dir before we begin to ensure there are no old logs.</p>
<p style="padding-left:30px;">Rem &#8212; System state backup &#8212;</p>
<p style="padding-left:30px;">ntbackup backup systemstate /f %backdes%%computername%-systemstate-%cdate%.bkf /j &#8220;systemstate&#8221; /l:s<br />
FOR /F &#8220;usebackq tokens=1&#8243; %%n IN (`dir %logfiledir% /b`) DO ren %logfiledir%%%n %computername%-&#8220;systemstate&#8221;-%cdate%.log<br />
move /y %logfiledir%*.log %logdest%</p>
<p>Kicking off with systemstate, ntbackup runs taking a snapshot of the servers system state and saving it as servername-systemstate-date.bkf in the folder you defined in %backdes%.</p>
<p>The for statement after the script may look a little strange, this is old code i have used before to save a file using the date and time as a file name. all this simply says is: for all the files in %logfiledir% rename them to servername-systemstate-date.log</p>
<p>Once the file is renamed, the script moves the logfile off to the %logdest%, creating a report of your system state backup.</p>
<p style="padding-left:30px;">Rem &#8212; hard drive backup &#8212;<br />
Rem &#8212; Copy and paste from here downwards for multiple drives&#8212;<br />
ntbackup backup <strong>c:</strong> /f %backdes%%computername%-<strong>cdrive</strong>-%cdate%.bkf /j &#8220;<strong>C Drive</strong>&#8221; /l:s</p>
<p style="padding-left:30px;">FOR /F &#8220;usebackq tokens=1&#8243; %%n IN (`dir %logfiledir% /b`) DO ren %logfiledir%%%n %computername%-&#8220;<strong>Cdrive</strong>&#8220;-%cdate%.log<br />
move /y %logfiledir%*.log %logdest%<br />
Rem &#8212; end copy &#8212;</p>
<p>Now the above is a drive backup, as with the last portion, the script kicks off a backup of the system drive c: calling the file computername%-cdrive-date.bkf saving it in %backdes%. Once the backup is complete it will rename the logfile to servername-&#8220;Cdrive&#8221;-date.log and move it to the logdest folder.</p>
<p>if you wish to backup more than one drive, i.e. C:, D: and E: simply copy and paste from the Rem&#8217;s specified above changing the bold text.</p>
<p>And thats it! you now have a fully functioning backup script that will backup system state and the drives you specify and will save them in a network folder for you to commit to tape, or move off site each day.</p>
<p>The script in full is available <a href="http://www.4shared.com/file/59861403/c92d200c/backup.html">here:</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/08/ntbackup-part-1-scripting-nt-backup/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
