<?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>Sysadmin Geek</title>
	<atom:link href="http://sysadmingeek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysadmingeek.com</link>
	<description>Your Complete IT Guide</description>
	<lastBuildDate>Fri, 30 Jul 2010 11:00:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Restoring a SQL Database Backup Using SQL Server Management Studio</title>
		<link>http://sysadmingeek.com/articles/restoring-a-sql-database-backup-using-sql-server-management-studio/</link>
		<comments>http://sysadmingeek.com/articles/restoring-a-sql-database-backup-using-sql-server-management-studio/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 11:00:22 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server 2008]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=354</guid>
		<description><![CDATA[<p>We have previously covered a <a href="http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line">simple SQL database restore using the command line</a> which is ideal for restoring backup files created on the same SQL Server installation, however if you are restoring a backup created on a different installation or simply prefer a point and click interface, using SQL Server Management Studio (or the Express edition) makes this task easy.</p>
<p><em>Note: SQL Server experts might want to skip today&#8217;s lesson, as it&#8217;s aimed at beginners.</em></p>
<p>Before starting, you will need to copy the SQL backup file (typically has a .BAK extension) to a local hard drive on the destination SQL Server machine.</p>
<p>Open SQL Server Management Studio and login to the SQL Server you want to restore the database to. It is best to either login as a Windows Administrator or as the SQL ‘sa’ user.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb.png" border="0" alt="image" width="454" height="349" /></a></p>
<p>Once logged in, right click on the Databases folder and select ‘Restore Database’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image1.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb1.png" border="0" alt="image" width="326" height="265" /></a></p>
<p>Click the ellipses button next to ‘From device’ under the ‘Source for restore’ section.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image2.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb2.png" border="0" alt="image" width="523" height="150" /></a></p>
<p>Set ‘File’ as the backup media and then click ‘Add’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image3.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb3.png" border="0" alt="image" width="528" height="392" /></a></p>
<p>Browse to the SQL backup (BAK) file you want to restore.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image4.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb4.png" border="0" alt="image" width="463" height="636" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image5.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb5.png" border="0" alt="image" width="528" height="392" /></a></p>
<p>In the Restore Database dialog, type or select the name of the database you want this backup restored to.</p>
<ul>
<li>If you select an existing database, it will be replaced with the data from the backup.</li>
<li>If you type a database name which does not currently exist in your SQL Server installation, it will be created.</li>
</ul>
<p>Next, select the restore point you want to use. Since a SQL backup file can hold multiple backups you may see more than one restore point listed.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image6.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb6.png" border="0" alt="image" width="539" height="545" /></a></p>
<p>At this point, enough information has been entered for the database to be restored. However, SQL backup files store information about where data files are copied so if there are any file system problems such as a the destination directory not existing or conflicting data file names an error will occur. These problems are common when restoring a backup created on a different SQL Server installation.</p>
<p>To review and change the file system settings, click the Options page on the left in the Restore Database dialog.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image7.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb7.png" border="0" alt="image" width="216" height="137" /></a></p>
<p>On the options page, you will want to make sure the ‘Restore As’ column points to valid folder locations (you can change them as needed). The the files do not have to exist, however the folder path must exist. If the respective files do exist, SQL Server follows a simple set of rules:</p>
<ul>
<li>If the ‘To database’ (from the General page) matches the restore database backup (i.e. restoring to matching databases), the respective files will be overwritten as part of the restore.</li>
<li>If the ‘To database’ does not match the restore database backup (i.e. restoring to a different database), the ‘Overwrite the existing database’ will need to be checked for the restore process to complete. Use this function with caution as you can potentially restore database backup information on top of data files from a completely different database.</li>
</ul>
<p>Generally, you can tell the databases differ based on the ‘Original File Name’ which is the internal name SQL Server uses to reference the respective files.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image8.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb8.png" border="0" alt="image" width="589" height="545" /></a></p>
<p>Once your restore options are set, click Ok.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image9.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb9.png" border="0" alt="image" width="600" height="153" /></a></p>
<h2>Conclusion</h2>
<p>SQL Server Management Studio makes the restore process simple and is ideal if you seldom perform database restores. This process works in every version of SQL Server from Express to Enterprise. If you are using the Express version, you can download SQL Server Management Studio Express to get access to this interface.</p>
<h2>Links</h2>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796">Download SQL Server Management Studio Express from Microsoft</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/restoring-a-sql-database-backup-using-sql-server-management-studio/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>We have previously covered a <a href="http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line">simple SQL database restore using the command line</a> which is ideal for restoring backup files created on the same SQL Server installation, however if you are restoring a backup created on a different installation or simply prefer a point and click interface, using SQL Server Management Studio (or the Express edition) makes this task easy.</p>
<p><em>Note: SQL Server experts might want to skip today&#8217;s lesson, as it&#8217;s aimed at beginners.</em></p>
<p>Before starting, you will need to copy the SQL backup file (typically has a .BAK extension) to a local hard drive on the destination SQL Server machine.</p>
<p>Open SQL Server Management Studio and login to the SQL Server you want to restore the database to. It is best to either login as a Windows Administrator or as the SQL ‘sa’ user.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb.png" border="0" alt="image" width="454" height="349" /></a></p>
<p>Once logged in, right click on the Databases folder and select ‘Restore Database’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image1.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb1.png" border="0" alt="image" width="326" height="265" /></a></p>
<p>Click the ellipses button next to ‘From device’ under the ‘Source for restore’ section.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image2.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb2.png" border="0" alt="image" width="523" height="150" /></a></p>
<p>Set ‘File’ as the backup media and then click ‘Add’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image3.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb3.png" border="0" alt="image" width="528" height="392" /></a></p>
<p>Browse to the SQL backup (BAK) file you want to restore.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image4.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb4.png" border="0" alt="image" width="463" height="636" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image5.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb5.png" border="0" alt="image" width="528" height="392" /></a></p>
<p>In the Restore Database dialog, type or select the name of the database you want this backup restored to.</p>
<ul>
<li>If you select an existing database, it will be replaced with the data from the backup.</li>
<li>If you type a database name which does not currently exist in your SQL Server installation, it will be created.</li>
</ul>
<p>Next, select the restore point you want to use. Since a SQL backup file can hold multiple backups you may see more than one restore point listed.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image6.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb6.png" border="0" alt="image" width="539" height="545" /></a></p>
<p>At this point, enough information has been entered for the database to be restored. However, SQL backup files store information about where data files are copied so if there are any file system problems such as a the destination directory not existing or conflicting data file names an error will occur. These problems are common when restoring a backup created on a different SQL Server installation.</p>
<p>To review and change the file system settings, click the Options page on the left in the Restore Database dialog.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image7.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb7.png" border="0" alt="image" width="216" height="137" /></a></p>
<p>On the options page, you will want to make sure the ‘Restore As’ column points to valid folder locations (you can change them as needed). The the files do not have to exist, however the folder path must exist. If the respective files do exist, SQL Server follows a simple set of rules:</p>
<ul>
<li>If the ‘To database’ (from the General page) matches the restore database backup (i.e. restoring to matching databases), the respective files will be overwritten as part of the restore.</li>
<li>If the ‘To database’ does not match the restore database backup (i.e. restoring to a different database), the ‘Overwrite the existing database’ will need to be checked for the restore process to complete. Use this function with caution as you can potentially restore database backup information on top of data files from a completely different database.</li>
</ul>
<p>Generally, you can tell the databases differ based on the ‘Original File Name’ which is the internal name SQL Server uses to reference the respective files.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image8.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb8.png" border="0" alt="image" width="589" height="545" /></a></p>
<p>Once your restore options are set, click Ok.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image9.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb9.png" border="0" alt="image" width="600" height="153" /></a></p>
<h2>Conclusion</h2>
<p>SQL Server Management Studio makes the restore process simple and is ideal if you seldom perform database restores. This process works in every version of SQL Server from Express to Enterprise. If you are using the Express version, you can download SQL Server Management Studio Express to get access to this interface.</p>
<h2>Links</h2>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796">Download SQL Server Management Studio Express from Microsoft</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/restoring-a-sql-database-backup-using-sql-server-management-studio/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/restoring-a-sql-database-backup-using-sql-server-management-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup and Restore Your SQL Server Database from the Command Line</title>
		<link>http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line/</link>
		<comments>http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 11:00:39 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[keyboard-ninja]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server 2003]]></category>
		<category><![CDATA[windows server 2008]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=295</guid>
		<description><![CDATA[<p>The most important part of a SQL Server maintenance plan is backing up your databases regularly. To backup a database, you cannot simply copy the respective MDF and LDF files of the database as SQL Server has a lock on these. Instead, you need to create a true backup file through SQL Server.</p>
<p>While this can be done by developing a Maintenance Plan inside of SQL Management Studio, the free Express editions of SQL Server do not offer this interface. To work around this, you can easily backup your databases by running the command below while logged in as a Windows Administrator:</p>
<blockquote><p>SqlCmd -E -S Server_Name –Q &#8220;BACKUP DATABASE [Name_of_Database] TO DISK=&#8217;X:\Path\To\Backup\Location\[Name_of_Database].bak&#8217;&#8221;</p></blockquote>
<p>The examples below will help.</p>
<p>Default SQL Server instance:</p>
<blockquote><p>SqlCmd -E -S MyServer –Q &#8220;BACKUP DATABASE [MyDB] TO DISK=&#8217;D:\Backups\MyDB.bak&#8217;&#8221;</p></blockquote>
<p>Named SQL Server instance:</p>
<blockquote><p>SqlCmd -E -S MyServer\MyInstance –Q &#8220;BACKUP DATABASE [MyDB] TO DISK=&#8217;D:\Backups\MyDB.bak&#8217;&#8221;</p></blockquote>
<p>The above create a fully restorable backup copy of “MyDB” to the file “D:\Backups\MyDB.bak” which can be used for disaster recovery. Of course, you can change the backup location and file to whatever you need, but make sure you specify a folder location which exists on the local machine. This backup file can then be copied to a tape drive or another external backup location.</p>
<p>A common question is “Can a backup file be created to a mapped drive or UNC location?” and the quick answer is no. The reason is because the SQL Server Windows Service runs as a user account which only has access to the local machine. You could change the account the service runs as, but this is highly discouraged for security reasons.</p>
<h2>Restoring a Database Backup from the Command Line</h2>
<p>To restore a database from a backup file, simply use the command:</p>
<blockquote><p>SqlCmd -E -S Server_Name –Q &#8220;RESTORE DATABASE [Name_of_Database] FROM DISK=&#8217;X:\Path\To\Backup\File\[File_Name].bak&#8217;&#8221;</p></blockquote>
<p>For example:</p>
<blockquote><p>SqlCmd -E -S MyServer –Q &#8220;RESTORE DATABASE [MyDB] FROM DISK=&#8217;D:\Backups\MyDB.bak&#8217;&#8221;</p></blockquote>
<p>The above command will restore a backup of “MyDB” from the data stored in the backup file “D:\Backups\MyDB.bak”. Any changes made to MyDB since the backup file was created will be lost.</p>
<p>An important thing to remember when using the above command is that it is intended to be used on the same SQL Server that the respective backup file was created on. SQL backup files store ‘behind the scenes’ information that control where and how the data files in the backup file are copied. If you are restoring a backup from a different SQL Server, the path locations in the backup file may not match the server you are restoring to and an error will result. While this can be worked around, it is much easier to restore backups created on another SQL Server using the SQL Management Studio tool.</p>
<p>Note: the commands above will work on SQL 2005 and higher (any edition). For SQL 2000 and earlier, replace &#8216;SqlCmd&#8217; with &#8216;oSql&#8217;.</p>
<p><br/><a href="http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>The most important part of a SQL Server maintenance plan is backing up your databases regularly. To backup a database, you cannot simply copy the respective MDF and LDF files of the database as SQL Server has a lock on these. Instead, you need to create a true backup file through SQL Server.</p>
<p>While this can be done by developing a Maintenance Plan inside of SQL Management Studio, the free Express editions of SQL Server do not offer this interface. To work around this, you can easily backup your databases by running the command below while logged in as a Windows Administrator:</p>
<blockquote><p>SqlCmd -E -S Server_Name –Q &#8220;BACKUP DATABASE [Name_of_Database] TO DISK=&#8217;X:\Path\To\Backup\Location\[Name_of_Database].bak&#8217;&#8221;</p></blockquote>
<p>The examples below will help.</p>
<p>Default SQL Server instance:</p>
<blockquote><p>SqlCmd -E -S MyServer –Q &#8220;BACKUP DATABASE [MyDB] TO DISK=&#8217;D:\Backups\MyDB.bak&#8217;&#8221;</p></blockquote>
<p>Named SQL Server instance:</p>
<blockquote><p>SqlCmd -E -S MyServer\MyInstance –Q &#8220;BACKUP DATABASE [MyDB] TO DISK=&#8217;D:\Backups\MyDB.bak&#8217;&#8221;</p></blockquote>
<p>The above create a fully restorable backup copy of “MyDB” to the file “D:\Backups\MyDB.bak” which can be used for disaster recovery. Of course, you can change the backup location and file to whatever you need, but make sure you specify a folder location which exists on the local machine. This backup file can then be copied to a tape drive or another external backup location.</p>
<p>A common question is “Can a backup file be created to a mapped drive or UNC location?” and the quick answer is no. The reason is because the SQL Server Windows Service runs as a user account which only has access to the local machine. You could change the account the service runs as, but this is highly discouraged for security reasons.</p>
<h2>Restoring a Database Backup from the Command Line</h2>
<p>To restore a database from a backup file, simply use the command:</p>
<blockquote><p>SqlCmd -E -S Server_Name –Q &#8220;RESTORE DATABASE [Name_of_Database] FROM DISK=&#8217;X:\Path\To\Backup\File\[File_Name].bak&#8217;&#8221;</p></blockquote>
<p>For example:</p>
<blockquote><p>SqlCmd -E -S MyServer –Q &#8220;RESTORE DATABASE [MyDB] FROM DISK=&#8217;D:\Backups\MyDB.bak&#8217;&#8221;</p></blockquote>
<p>The above command will restore a backup of “MyDB” from the data stored in the backup file “D:\Backups\MyDB.bak”. Any changes made to MyDB since the backup file was created will be lost.</p>
<p>An important thing to remember when using the above command is that it is intended to be used on the same SQL Server that the respective backup file was created on. SQL backup files store ‘behind the scenes’ information that control where and how the data files in the backup file are copied. If you are restoring a backup from a different SQL Server, the path locations in the backup file may not match the server you are restoring to and an error will result. While this can be worked around, it is much easier to restore backups created on another SQL Server using the SQL Management Studio tool.</p>
<p>Note: the commands above will work on SQL 2005 and higher (any edition). For SQL 2000 and earlier, replace &#8216;SqlCmd&#8217; with &#8216;oSql&#8217;.</p>
<p><br/><a href="http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/backup-your-sql-server-database-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Save Typing by Reusing All Arguments of the Previous Linux Command</title>
		<link>http://sysadmingeek.com/articles/save-typing-by-reusing-all-arguments-of-the-previous-command/</link>
		<comments>http://sysadmingeek.com/articles/save-typing-by-reusing-all-arguments-of-the-previous-command/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 00:00:59 +0000</pubDate>
		<dc:creator>The How-To Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[howtogeek]]></category>
		<category><![CDATA[keyboard-ninja]]></category>
		<category><![CDATA[nofeed]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=837</guid>
		<description><![CDATA[<p>You might want to reuse all of the arguments to a previous command in the shell if you realized you want to open the file with a different utility, but don&#8217;t feel like typing out the whole path again.</p>
<p>For instance, say you ran a cat on a file deep within a folder structure, like this:</p>
<blockquote><p>cat /home/geek/documents/testfiles/testfile1</p></blockquote>
<p>If you want to open that file up in vi, you don&#8217;t have to retype the whole command (or hit the up key and edit the command). Just type in the following:</p>
<blockquote><p>vi !*</p></blockquote>
<p>This would be expanded out to:</p>
<blockquote><p>vi /home/geek/documents/testfiles/testfile1</p></blockquote>
<p>Saves some typing, and just a useful command to know.</p>
<p><br/><a href="http://sysadmingeek.com/articles/save-typing-by-reusing-all-arguments-of-the-previous-command/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>You might want to reuse all of the arguments to a previous command in the shell if you realized you want to open the file with a different utility, but don&#8217;t feel like typing out the whole path again.</p>
<p>For instance, say you ran a cat on a file deep within a folder structure, like this:</p>
<blockquote><p>cat /home/geek/documents/testfiles/testfile1</p></blockquote>
<p>If you want to open that file up in vi, you don&#8217;t have to retype the whole command (or hit the up key and edit the command). Just type in the following:</p>
<blockquote><p>vi !*</p></blockquote>
<p>This would be expanded out to:</p>
<blockquote><p>vi /home/geek/documents/testfiles/testfile1</p></blockquote>
<p>Saves some typing, and just a useful command to know.</p>
<p><br/><a href="http://sysadmingeek.com/articles/save-typing-by-reusing-all-arguments-of-the-previous-command/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/save-typing-by-reusing-all-arguments-of-the-previous-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install PHP on IIS 7 for Windows Server 2008</title>
		<link>http://sysadmingeek.com/articles/how-to-install-php-on-iis-7-for-windows-server-2008/</link>
		<comments>http://sysadmingeek.com/articles/how-to-install-php-on-iis-7-for-windows-server-2008/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 11:00:58 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[setup guides]]></category>
		<category><![CDATA[web-servers]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server 2008]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=432</guid>
		<description><![CDATA[<p>One of most popular development platforms on the web is PHP which powers many popular applications and sites such as Facebook, Wordpress and Joomla. While most of these systems are ‘designed’ to be used on a Linux system running the Apache Web Server, you can deploy PHP applications via IIS 7 on your Windows Server 2008 system.</p>
<h2>Configuring PHP</h2>
<p>In order for Windows to run PHP code, the PHP binary files need to be copied to your system. No installation is required, however some configuration must be done in order for it to properly run. The first step is to download the PHP Windows Binaries and extract them (i.e. ‘C:\PHP’). For IIS 7, the <em>non thread safe</em> binaries should be used.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image28.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb28.png" border="0" alt="image" width="615" height="391" /></a></p>
<p>Copy the ‘php.ini-production’ file from the extracted files paste it into the Windows directory. In the Windows directory, rename this file to ‘php.ini’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image29.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb29.png" border="0" alt="image" width="615" height="391" /></a></p>
<p>Open the ‘php.ini’ file in Notepad and configure it as needed. Out of the box, the production configuration we copied is preconfigured for what the PHP Team feels is good for a production server. There are a few changes you will need to make to configure PHP for your IIS 7 system:</p>
<ul>
<li>Uncomment and set the key, <em>cgi.force_redirect = 0</em></li>
<li>Uncomment the key, <em>fastcgi.impersonate = 1</em></li>
<li>Uncomment and set the key, extension_dir to the ‘ext’ folder in the path PHP was extracted to (i.e. ‘C:\PHP\ext’).</li>
<li>Set the key, <em>date.timezone</em> to the time zone of your server (the URL on the line above this key lists the accepted values).</li>
</ul>
<p>At this point, your Windows system can run PHP scripts from the command line using the ‘php.exe’ tool.</p>
<h2>Configuring IIS 7 to Run FastCGI</h2>
<p>Internet Information Services (IIS) 7 includes the FastCGI framework as part of the installation package. To make sure it is enabled in your IIS 7 installation, check the Role Services under Server Manager &#62; Roles &#62; Web Server.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image30.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb30.png" border="0" alt="image" width="667" height="311" /></a></p>
<p>Make sure the “CGI” option is installed under the “Application Development” section. If it is not, enable this feature and update your IIS 7 installation.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image31.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb31.png" border="0" alt="image" width="590" height="526" /></a></p>
<p>Once IIS is set, install the IIS 7 Administration Pack. If you do not use the “Typical” setup then make sure you have the “FastCGI” option set to install. This package installs the FastCGI configuration interface inside the IIS Manager.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image32.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb32.png" border="0" alt="image" width="527" height="413" /></a></p>
<h2>Configuring IIS to Run PHP via FastCGI</h2>
<p>Once IIS 7 is setup with all the required features, we just need to configure it to run PHP. First, we configure FastCGI to work with PHP under the “FastCGI Settings” option (this feature is installed as part of the IIS 7 Administration Pack).</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image33.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb33.png" border="0" alt="image" width="668" height="508" /></a></p>
<p>In the FastCGI Settings screen, add an application.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image34.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb34.png" border="0" alt="image" width="668" height="210" /></a></p>
<p>Set the path to the ‘php-cgi.exe’ executable located in the folder where you extracted the PHP Windows binaries. Additionally, change the “InstanceMaxRequests” to a value higher than the default (i.e. 5000). Under the “EnvironmentVariables” setting, click the ellipses button to configure additional options.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image35.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb35.png" border="0" alt="image" width="468" height="493" /></a></p>
<p>Add a new variable named “PHP_MAX_REQUESTS” and set the value to the same amount as the “InstanceMaxRequests” setting above.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image36.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb36.png" border="0" alt="image" width="583" height="166" /></a></p>
<p>Apply all settings until you get back to the primary IIS Manager screen.</p>
<p>Next, we have to map how PHP scripts are executed by IIS which is configured in “Handler Mappings”.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image37.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb37.png" border="0" alt="image" width="668" height="508" /></a></p>
<p>In the Handler Mappings, add a new module mapping.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image38.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb38.png" border="0" alt="image" width="668" height="508" /></a></p>
<p>Set the module’s request path to PHP files (*.php) with the module interface “FastCgiModule”. Set the executable to the same file as what was configured in the FastCGI settings above. Assign a friendly name to this mapping, such as PHP, and click Ok.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image39.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb39.png" border="0" alt="image" width="424" height="373" /></a></p>
<p>When you get the confirmation prompt, answer “Yes” to confirm you want PHP to run as a FastCGI application.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image40.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb40.png" border="0" alt="image" width="441" height="180" /></a></p>
<p>Apply all your changes, close and restart IIS to make sure the new settings take effect.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image41.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb41.png" border="0" alt="image" width="369" height="167" /></a></p>
<p>Once this is done, there is a Microsoft hotfix available (a link is available in the links section) which addresses some issues with PHP when running under IIS 7. These should be installed on your web server to ensure PHP functions properly through FastCGI.</p>
<h2>Testing PHP</h2>
<p>At this point, your server is ready to go, but just to be sure we can confirm your PHP setup through IIS pretty easily. Create a text file in the directory ‘C:\Inetpub\wwwroot’ named ‘phpinfo.php’ which simply contains the line:</p>
<blockquote><p>&#60;?php phpinfo(); ?&#62;</p></blockquote>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image42.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb42.png" border="0" alt="image" width="318" height="180" /></a></p>
<p>Finally, browse to the address: ‘http://localhost/phpinfo.php’ on your server and you should see the PHP information page. If the page loads successfully, PHP is now up and running on your machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/04/image33.png"><img style="border: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/04/image33_thumb.png" border="0" alt="image" width="679" height="556" /></a></p>
<h2>Conclusion</h2>
<p>Once you have PHP up and running on your Windows system, you can take advantage of the multitude of PHP based applications available as well as develop and deploy your own.</p>
<h2>Links</h2>
<p><a href="http://windows.php.net/download/">Download PHP Windows Binaries</a> (non thread safe)</p>
<p><a href="http://www.iis.net/expand/AdministrationPack">Download IIS 7 Administration Pack</a></p>
<p>Download PHP Hotfix for IIS 7 FastCGI (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=d0343911-1775-4aef-8c99-5f13862ac386">x86</a> / <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=70278393-3291-4aa1-870b-0e9b0907bddf">x64</a>)</p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-install-php-on-iis-7-for-windows-server-2008/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>One of most popular development platforms on the web is PHP which powers many popular applications and sites such as Facebook, Wordpress and Joomla. While most of these systems are ‘designed’ to be used on a Linux system running the Apache Web Server, you can deploy PHP applications via IIS 7 on your Windows Server 2008 system.</p>
<h2>Configuring PHP</h2>
<p>In order for Windows to run PHP code, the PHP binary files need to be copied to your system. No installation is required, however some configuration must be done in order for it to properly run. The first step is to download the PHP Windows Binaries and extract them (i.e. ‘C:\PHP’). For IIS 7, the <em>non thread safe</em> binaries should be used.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image28.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb28.png" border="0" alt="image" width="615" height="391" /></a></p>
<p>Copy the ‘php.ini-production’ file from the extracted files paste it into the Windows directory. In the Windows directory, rename this file to ‘php.ini’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image29.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb29.png" border="0" alt="image" width="615" height="391" /></a></p>
<p>Open the ‘php.ini’ file in Notepad and configure it as needed. Out of the box, the production configuration we copied is preconfigured for what the PHP Team feels is good for a production server. There are a few changes you will need to make to configure PHP for your IIS 7 system:</p>
<ul>
<li>Uncomment and set the key, <em>cgi.force_redirect = 0</em></li>
<li>Uncomment the key, <em>fastcgi.impersonate = 1</em></li>
<li>Uncomment and set the key, extension_dir to the ‘ext’ folder in the path PHP was extracted to (i.e. ‘C:\PHP\ext’).</li>
<li>Set the key, <em>date.timezone</em> to the time zone of your server (the URL on the line above this key lists the accepted values).</li>
</ul>
<p>At this point, your Windows system can run PHP scripts from the command line using the ‘php.exe’ tool.</p>
<h2>Configuring IIS 7 to Run FastCGI</h2>
<p>Internet Information Services (IIS) 7 includes the FastCGI framework as part of the installation package. To make sure it is enabled in your IIS 7 installation, check the Role Services under Server Manager &gt; Roles &gt; Web Server.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image30.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb30.png" border="0" alt="image" width="667" height="311" /></a></p>
<p>Make sure the “CGI” option is installed under the “Application Development” section. If it is not, enable this feature and update your IIS 7 installation.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image31.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb31.png" border="0" alt="image" width="590" height="526" /></a></p>
<p>Once IIS is set, install the IIS 7 Administration Pack. If you do not use the “Typical” setup then make sure you have the “FastCGI” option set to install. This package installs the FastCGI configuration interface inside the IIS Manager.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image32.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb32.png" border="0" alt="image" width="527" height="413" /></a></p>
<h2>Configuring IIS to Run PHP via FastCGI</h2>
<p>Once IIS 7 is setup with all the required features, we just need to configure it to run PHP. First, we configure FastCGI to work with PHP under the “FastCGI Settings” option (this feature is installed as part of the IIS 7 Administration Pack).</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image33.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb33.png" border="0" alt="image" width="668" height="508" /></a></p>
<p>In the FastCGI Settings screen, add an application.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image34.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb34.png" border="0" alt="image" width="668" height="210" /></a></p>
<p>Set the path to the ‘php-cgi.exe’ executable located in the folder where you extracted the PHP Windows binaries. Additionally, change the “InstanceMaxRequests” to a value higher than the default (i.e. 5000). Under the “EnvironmentVariables” setting, click the ellipses button to configure additional options.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image35.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb35.png" border="0" alt="image" width="468" height="493" /></a></p>
<p>Add a new variable named “PHP_MAX_REQUESTS” and set the value to the same amount as the “InstanceMaxRequests” setting above.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image36.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb36.png" border="0" alt="image" width="583" height="166" /></a></p>
<p>Apply all settings until you get back to the primary IIS Manager screen.</p>
<p>Next, we have to map how PHP scripts are executed by IIS which is configured in “Handler Mappings”.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image37.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb37.png" border="0" alt="image" width="668" height="508" /></a></p>
<p>In the Handler Mappings, add a new module mapping.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image38.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb38.png" border="0" alt="image" width="668" height="508" /></a></p>
<p>Set the module’s request path to PHP files (*.php) with the module interface “FastCgiModule”. Set the executable to the same file as what was configured in the FastCGI settings above. Assign a friendly name to this mapping, such as PHP, and click Ok.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image39.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb39.png" border="0" alt="image" width="424" height="373" /></a></p>
<p>When you get the confirmation prompt, answer “Yes” to confirm you want PHP to run as a FastCGI application.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image40.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb40.png" border="0" alt="image" width="441" height="180" /></a></p>
<p>Apply all your changes, close and restart IIS to make sure the new settings take effect.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image41.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb41.png" border="0" alt="image" width="369" height="167" /></a></p>
<p>Once this is done, there is a Microsoft hotfix available (a link is available in the links section) which addresses some issues with PHP when running under IIS 7. These should be installed on your web server to ensure PHP functions properly through FastCGI.</p>
<h2>Testing PHP</h2>
<p>At this point, your server is ready to go, but just to be sure we can confirm your PHP setup through IIS pretty easily. Create a text file in the directory ‘C:\Inetpub\wwwroot’ named ‘phpinfo.php’ which simply contains the line:</p>
<blockquote><p>&lt;?php phpinfo(); ?&gt;</p></blockquote>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image42.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb42.png" border="0" alt="image" width="318" height="180" /></a></p>
<p>Finally, browse to the address: ‘http://localhost/phpinfo.php’ on your server and you should see the PHP information page. If the page loads successfully, PHP is now up and running on your machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/04/image33.png"><img style="border: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/04/image33_thumb.png" border="0" alt="image" width="679" height="556" /></a></p>
<h2>Conclusion</h2>
<p>Once you have PHP up and running on your Windows system, you can take advantage of the multitude of PHP based applications available as well as develop and deploy your own.</p>
<h2>Links</h2>
<p><a href="http://windows.php.net/download/">Download PHP Windows Binaries</a> (non thread safe)</p>
<p><a href="http://www.iis.net/expand/AdministrationPack">Download IIS 7 Administration Pack</a></p>
<p>Download PHP Hotfix for IIS 7 FastCGI (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=d0343911-1775-4aef-8c99-5f13862ac386">x86</a> / <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=70278393-3291-4aa1-870b-0e9b0907bddf">x64</a>)</p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-install-php-on-iis-7-for-windows-server-2008/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/how-to-install-php-on-iis-7-for-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch Script to Auto Update Sysinternals Tools</title>
		<link>http://sysadmingeek.com/articles/batch-script-to-auto-update-sysinternals-tools/</link>
		<comments>http://sysadmingeek.com/articles/batch-script-to-auto-update-sysinternals-tools/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:00:16 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[batch scripts]]></category>
		<category><![CDATA[portable]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysinternals]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=356</guid>
		<description><![CDATA[<p>While the Microsoft Sysinternals tools are incredibly powerful and useful, the one feature they lack is the ability to check for new versions. Currently, you have to periodically check the Sysinternals site and compare versions between your system and the most recent official release in order to stay up to date.</p>
<p>As a better solution, we have created a batch script which will automatically update the Sysinternals tools you have on your system. All you have to do is put the batch script file into the folder where your Sysinternals tools are located and the script does the rest, no configuration is needed.</p>
<p>Here is how it works:</p>
<ul>
<li>The current list of tools from Sysinternals is downloaded and compared to the files on your system.</li>
<li>If a match is found, the current version from Sysinternals is copied to your system.</li>
<li>If a tool is currently running, it is closed and then restarted once the script completes.</li>
</ul>
<h2>The Script</h2>
<pre>@ECHO OFF
TITLE Sysinternals Updater
ECHO Sysintenals Updater
ECHO Written by: Jason Faulkner
ECHO SysadminGeek.com
ECHO.
ECHO.

SETLOCAL ENABLEDELAYEDEXPANSION

SET SysInternalsTools="%Temp%\SysInternalsTools.tmp.txt"
SET CurrentTasks="%Temp%\CurrentTasks.tmp.txt"
SET StartWhenFinished="%Temp%\StartWhenFinished.tmp.txt"

ECHO Detected directory: %~dp0
%~d0
CD %~p0
ECHO.
ECHO.

ECHO Downloading current tool list...
SET LiveShare=\\live.sysinternals.com\tools
START /MIN %LiveShare%
DIR %LiveShare% /B &#62; %SysInternalsTools%
TASKLIST &#62; %CurrentTasks%
ECHO ;Terminated tools &#62; %StartWhenFinished%

ECHO.
ECHO Updating installed SysInternals tools
FOR /F %%A IN ('DIR /B') DO (
   FOR /F "usebackq" %%B IN (%SysInternalsTools%) DO (
      IF /I [%%A]==[%%B] (
         ECHO Updating %%A
         FOR /F "usebackq" %%C IN (%CurrentTasks%) DO (
            IF /I [%%A]==[%%C] (
               ECHO %%C is currently running, killing process - queue restart
               ECHO %%C &#62;&#62; %StartWhenFinished%
               TASKKILL /IM %%A /T /F
            )
         )
         XCOPY %LiveShare%\%%B %%A /Y
         ECHO.
      )
   )
)

ECHO.
ECHO Resuming killed tasks
FOR /F "usebackq skip=1" %%A IN (%StartWhenFinished%) DO (
   ECHO Starting %%A
   START "Sysinternals Tool" "%%A"
)

IF EXIST %SysInternalsTools% DEL %SysInternalsTools%
IF EXIST %CurrentTasks% DEL %CurrentTasks%
IF EXIST %StartWhenFinished% DEL %StartWhenFinished%

ENDLOCAL

ECHO.
PAUSE</pre>
<h2>Links</h2>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/Script-SysinternalsUpdater.zip">Download Sysinternals Updater Script from Sysadmin Geek</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/batch-script-to-auto-update-sysinternals-tools/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>While the Microsoft Sysinternals tools are incredibly powerful and useful, the one feature they lack is the ability to check for new versions. Currently, you have to periodically check the Sysinternals site and compare versions between your system and the most recent official release in order to stay up to date.</p>
<p>As a better solution, we have created a batch script which will automatically update the Sysinternals tools you have on your system. All you have to do is put the batch script file into the folder where your Sysinternals tools are located and the script does the rest, no configuration is needed.</p>
<p>Here is how it works:</p>
<ul>
<li>The current list of tools from Sysinternals is downloaded and compared to the files on your system.</li>
<li>If a match is found, the current version from Sysinternals is copied to your system.</li>
<li>If a tool is currently running, it is closed and then restarted once the script completes.</li>
</ul>
<h2>The Script</h2>
<pre>@ECHO OFF
TITLE Sysinternals Updater
ECHO Sysintenals Updater
ECHO Written by: Jason Faulkner
ECHO SysadminGeek.com
ECHO.
ECHO.

SETLOCAL ENABLEDELAYEDEXPANSION

SET SysInternalsTools="%Temp%\SysInternalsTools.tmp.txt"
SET CurrentTasks="%Temp%\CurrentTasks.tmp.txt"
SET StartWhenFinished="%Temp%\StartWhenFinished.tmp.txt"

ECHO Detected directory: %~dp0
%~d0
CD %~p0
ECHO.
ECHO.

ECHO Downloading current tool list...
SET LiveShare=\\live.sysinternals.com\tools
START /MIN %LiveShare%
DIR %LiveShare% /B &gt; %SysInternalsTools%
TASKLIST &gt; %CurrentTasks%
ECHO ;Terminated tools &gt; %StartWhenFinished%

ECHO.
ECHO Updating installed SysInternals tools
FOR /F %%A IN ('DIR /B') DO (
   FOR /F "usebackq" %%B IN (%SysInternalsTools%) DO (
      IF /I [%%A]==[%%B] (
         ECHO Updating %%A
         FOR /F "usebackq" %%C IN (%CurrentTasks%) DO (
            IF /I [%%A]==[%%C] (
               ECHO %%C is currently running, killing process - queue restart
               ECHO %%C &gt;&gt; %StartWhenFinished%
               TASKKILL /IM %%A /T /F
            )
         )
         XCOPY %LiveShare%\%%B %%A /Y
         ECHO.
      )
   )
)

ECHO.
ECHO Resuming killed tasks
FOR /F "usebackq skip=1" %%A IN (%StartWhenFinished%) DO (
   ECHO Starting %%A
   START "Sysinternals Tool" "%%A"
)

IF EXIST %SysInternalsTools% DEL %SysInternalsTools%
IF EXIST %CurrentTasks% DEL %CurrentTasks%
IF EXIST %StartWhenFinished% DEL %StartWhenFinished%

ENDLOCAL

ECHO.
PAUSE</pre>
<h2>Links</h2>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/Script-SysinternalsUpdater.zip">Download Sysinternals Updater Script from Sysadmin Geek</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/batch-script-to-auto-update-sysinternals-tools/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/batch-script-to-auto-update-sysinternals-tools/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to Install PHP on IIS 6 for Windows Server 2003</title>
		<link>http://sysadmingeek.com/articles/how-to-install-php-on-iis-6-for-windows-server-2003/</link>
		<comments>http://sysadmingeek.com/articles/how-to-install-php-on-iis-6-for-windows-server-2003/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 11:00:24 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[setup guides]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server 2003]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=455</guid>
		<description><![CDATA[<p>One of most popular development platforms on the web is PHP which powers many popular applications and sites such as Facebook, Wordpress and Joomla. While most of these systems are ‘designed’ to be used on a Linux system running the Apache Web Server, you can deploy PHP applications via IIS 6 on your Windows Server 2003 system.</p>
<h2>Configuring PHP</h2>
<p>In order for Windows to run PHP code, the PHP binary files need to be copied to your system. No installation is required, however some configuration must be done in order for it to properly run. The first step is to download the PHP Windows Binaries and extract them (i.e. ‘C:\PHP’). For IIS 6, the <em>non thread safe</em> binaries should be used.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image44.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb44.png" border="0" alt="image" width="637" height="382" /></a></p>
<p>Copy the ‘php.ini-production’ file from the extracted files paste it into the Windows directory. In the Windows directory, rename this file to ‘php.ini’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image45.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb45.png" border="0" alt="image" width="638" height="382" /></a></p>
<p>Open the ‘php.ini’ file in Notepad and configure it as needed. Out of the box, the production configuration we copied is preconfigured for what the PHP Team feels is good for a production server. There are a few changes you will need to make to configure PHP for your IIS 6 system:</p>
<ul>
<li>Uncomment and set the key, <em>cgi.force_redirect = 0</em></li>
<li>Uncomment the key, <em>fastcgi.impersonate = 1</em></li>
<li>Uncomment and set the key, extension_dir to the ‘ext’ folder in the path PHP was extracted to (i.e. ‘C:\PHP\ext’).</li>
<li>Set the key, <em>date.timezone</em> to the time zone of your server (the URL on the line above this key lists the accepted values).</li>
</ul>
<p>At this point, your Windows system can run PHP scripts from the command line using the ‘php.exe’ tool.</p>
<h2>Installing the IIS 6 FastCGI Extension</h2>
<p>In order for Internet Information Services (IIS) 6 to execute and serve PHP scripts, some additional configuration is required. In this guide, we will install PHP on IIS using the FastCGI interface which provides a good balance of stability and performance. Since FastCGI is not included with IIS 6 be default, we need to download and install it.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image46.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb46.png" border="0" alt="image" width="527" height="413" /></a></p>
<p>The FastCGI installer does not require any configuration, however once the FastCGI extension is installed we need to configure it to run PHP.</p>
<p>Open the file ‘C:\WINDOWS\system32\inetsrv\fcgiext.ini’ in Notepad and find the ‘Types’ section and enter the configuration information:</p>
<blockquote><p>[Types]<br />
php=PHP</p>
<p>[PHP]<br />
ExePath=C:\PHP\php-cgi.exe<br />
InstanceMaxRequests=5000<br />
EnvironmentVars=PHP_MAX_REQUESTS:5000</p></blockquote>
<p>Revise these values as needed according to your environment, but it is important that all of settings have the correct values. Once you are finished, save this file.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image47.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb47.png" border="0" alt="image" width="420" height="213" /></a></p>
<h2>Configuring IIS to Run PHP via FastCGI</h2>
<p>With both PHP and FastCGI installed and configured, all that is left is to set up IIS 6. When you open the IIS Management Console, under the Web Service Extensions make sure the “FastCGI Handler” is set to allowed.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image310.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image3_thumb.png" border="0" alt="image" width="666" height="480" /></a></p>
<p>Next, go to the Properties settings for the Web Sites group.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image48.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb48.png" border="0" alt="image" width="248" height="227" /></a></p>
<p>On the “Home Directory” tab, click the “Configuration” button.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image49.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb49.png" border="0" alt="image" width="500" height="486" /></a></p>
<p>Add a mapping for files with the .php file extension with the executable set to the FastCGI extension DLL.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image50.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb50.png" border="0" alt="image" width="457" height="271" /></a></p>
<p>Once you have applied all the changes, restart IIS.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image51.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb51.png" border="0" alt="image" width="361" height="146" /></a></p>
<h2>Testing PHP</h2>
<p>At this point, your server is ready to go, but just to be sure we can confirm your PHP setup through IIS pretty easily. Create a text file in the directory ‘C:\Inetpub\wwwroot’ named ‘phpinfo.php’ which simply contains the line:</p>
<blockquote><p>&#60;?php phpinfo(); ?&#62;</p></blockquote>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image52.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb52.png" border="0" alt="image" width="325" height="200" /></a></p>
<p>Finally, browse to the address: ‘http://localhost/phpinfo.php’ on your server and you should see the PHP information page. If the page loads successfully, PHP is now up and running on your machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image53.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb53.png" border="0" alt="image" width="675" height="522" /></a></p>
<h2>Conclusion</h2>
<p>Once you have PHP up and running on your Windows system, you can take advantage of the multitude of PHP based applications available as well as develop and deploy your own.</p>
<h2>Links</h2>
<p><a href="http://windows.php.net/download/">Download PHP Windows Binaries</a> (non thread safe)</p>
<p><a href="http://www.iis.net/expand/FastCGI">Download IIS 6 FastCGI Extension</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-install-php-on-iis-6-for-windows-server-2003/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>One of most popular development platforms on the web is PHP which powers many popular applications and sites such as Facebook, Wordpress and Joomla. While most of these systems are ‘designed’ to be used on a Linux system running the Apache Web Server, you can deploy PHP applications via IIS 6 on your Windows Server 2003 system.</p>
<h2>Configuring PHP</h2>
<p>In order for Windows to run PHP code, the PHP binary files need to be copied to your system. No installation is required, however some configuration must be done in order for it to properly run. The first step is to download the PHP Windows Binaries and extract them (i.e. ‘C:\PHP’). For IIS 6, the <em>non thread safe</em> binaries should be used.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image44.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb44.png" border="0" alt="image" width="637" height="382" /></a></p>
<p>Copy the ‘php.ini-production’ file from the extracted files paste it into the Windows directory. In the Windows directory, rename this file to ‘php.ini’.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image45.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb45.png" border="0" alt="image" width="638" height="382" /></a></p>
<p>Open the ‘php.ini’ file in Notepad and configure it as needed. Out of the box, the production configuration we copied is preconfigured for what the PHP Team feels is good for a production server. There are a few changes you will need to make to configure PHP for your IIS 6 system:</p>
<ul>
<li>Uncomment and set the key, <em>cgi.force_redirect = 0</em></li>
<li>Uncomment the key, <em>fastcgi.impersonate = 1</em></li>
<li>Uncomment and set the key, extension_dir to the ‘ext’ folder in the path PHP was extracted to (i.e. ‘C:\PHP\ext’).</li>
<li>Set the key, <em>date.timezone</em> to the time zone of your server (the URL on the line above this key lists the accepted values).</li>
</ul>
<p>At this point, your Windows system can run PHP scripts from the command line using the ‘php.exe’ tool.</p>
<h2>Installing the IIS 6 FastCGI Extension</h2>
<p>In order for Internet Information Services (IIS) 6 to execute and serve PHP scripts, some additional configuration is required. In this guide, we will install PHP on IIS using the FastCGI interface which provides a good balance of stability and performance. Since FastCGI is not included with IIS 6 be default, we need to download and install it.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image46.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb46.png" border="0" alt="image" width="527" height="413" /></a></p>
<p>The FastCGI installer does not require any configuration, however once the FastCGI extension is installed we need to configure it to run PHP.</p>
<p>Open the file ‘C:\WINDOWS\system32\inetsrv\fcgiext.ini’ in Notepad and find the ‘Types’ section and enter the configuration information:</p>
<blockquote><p>[Types]<br />
php=PHP</p>
<p>[PHP]<br />
ExePath=C:\PHP\php-cgi.exe<br />
InstanceMaxRequests=5000<br />
EnvironmentVars=PHP_MAX_REQUESTS:5000</p></blockquote>
<p>Revise these values as needed according to your environment, but it is important that all of settings have the correct values. Once you are finished, save this file.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image47.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb47.png" border="0" alt="image" width="420" height="213" /></a></p>
<h2>Configuring IIS to Run PHP via FastCGI</h2>
<p>With both PHP and FastCGI installed and configured, all that is left is to set up IIS 6. When you open the IIS Management Console, under the Web Service Extensions make sure the “FastCGI Handler” is set to allowed.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image310.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image3_thumb.png" border="0" alt="image" width="666" height="480" /></a></p>
<p>Next, go to the Properties settings for the Web Sites group.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image48.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb48.png" border="0" alt="image" width="248" height="227" /></a></p>
<p>On the “Home Directory” tab, click the “Configuration” button.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image49.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb49.png" border="0" alt="image" width="500" height="486" /></a></p>
<p>Add a mapping for files with the .php file extension with the executable set to the FastCGI extension DLL.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image50.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb50.png" border="0" alt="image" width="457" height="271" /></a></p>
<p>Once you have applied all the changes, restart IIS.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image51.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb51.png" border="0" alt="image" width="361" height="146" /></a></p>
<h2>Testing PHP</h2>
<p>At this point, your server is ready to go, but just to be sure we can confirm your PHP setup through IIS pretty easily. Create a text file in the directory ‘C:\Inetpub\wwwroot’ named ‘phpinfo.php’ which simply contains the line:</p>
<blockquote><p>&lt;?php phpinfo(); ?&gt;</p></blockquote>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image52.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb52.png" border="0" alt="image" width="325" height="200" /></a></p>
<p>Finally, browse to the address: ‘http://localhost/phpinfo.php’ on your server and you should see the PHP information page. If the page loads successfully, PHP is now up and running on your machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image53.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb53.png" border="0" alt="image" width="675" height="522" /></a></p>
<h2>Conclusion</h2>
<p>Once you have PHP up and running on your Windows system, you can take advantage of the multitude of PHP based applications available as well as develop and deploy your own.</p>
<h2>Links</h2>
<p><a href="http://windows.php.net/download/">Download PHP Windows Binaries</a> (non thread safe)</p>
<p><a href="http://www.iis.net/expand/FastCGI">Download IIS 6 FastCGI Extension</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-install-php-on-iis-6-for-windows-server-2003/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/how-to-install-php-on-iis-6-for-windows-server-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save the Last Executed Command to a File</title>
		<link>http://sysadmingeek.com/articles/save-the-last-executed-command-to-a-file/</link>
		<comments>http://sysadmingeek.com/articles/save-the-last-executed-command-to-a-file/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 00:00:04 +0000</pubDate>
		<dc:creator>The How-To Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[keyboard-ninja]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=833</guid>
		<description><![CDATA[<p>Have you ever typed out a really long command, realized it worked great, and then wanted to save it to a file? There&#8217;s an easy bash trick you can use to do just that.</p>
<blockquote><p>echo &#8220;!!&#8221; &#62; filename</p></blockquote>
<p>I sometimes use this trick when I&#8217;m building a script, but I&#8217;m not sure exactly what commands I want&#8230; so I type them out on the shell to make sure they execute properly, and then use the same command but with &#62;&#62; to append them to the end of the script I&#8217;m working on, like this:</p>
<blockquote><p>echo &#8220;!!&#8221; &#62;&#62; scriptname.sh</p></blockquote>
<p>If you execute another command after the last one, you can save that one like this:</p>
<blockquote><p>echo &#8220;!-2&#8243; &#62;&#62; scriptname.sh</p></blockquote>
<p>Very useful, or at least fun to learn.</p>
<p><br/><a href="http://sysadmingeek.com/articles/save-the-last-executed-command-to-a-file/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>Have you ever typed out a really long command, realized it worked great, and then wanted to save it to a file? There&#8217;s an easy bash trick you can use to do just that.</p>
<blockquote><p>echo &#8220;!!&#8221; &gt; filename</p></blockquote>
<p>I sometimes use this trick when I&#8217;m building a script, but I&#8217;m not sure exactly what commands I want&#8230; so I type them out on the shell to make sure they execute properly, and then use the same command but with &gt;&gt; to append them to the end of the script I&#8217;m working on, like this:</p>
<blockquote><p>echo &#8220;!!&#8221; &gt;&gt; scriptname.sh</p></blockquote>
<p>If you execute another command after the last one, you can save that one like this:</p>
<blockquote><p>echo &#8220;!-2&#8243; &gt;&gt; scriptname.sh</p></blockquote>
<p>Very useful, or at least fun to learn.</p>
<p><br/><a href="http://sysadmingeek.com/articles/save-the-last-executed-command-to-a-file/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/save-the-last-executed-command-to-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Resize a Microsoft Virtual Hard Drive (VHD) File</title>
		<link>http://sysadmingeek.com/articles/how-to-resize-a-microsoft-virtual-hard-drive-vhd-file/</link>
		<comments>http://sysadmingeek.com/articles/how-to-resize-a-microsoft-virtual-hard-drive-vhd-file/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 11:00:11 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[hard drives]]></category>
		<category><![CDATA[howtogeek]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[virtual pc]]></category>
		<category><![CDATA[virtual server]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server 2008]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=399</guid>
		<description><![CDATA[<p>When you create a Microsoft Virtual Hard Drive either through Virtual PC or Virtual Server, you have to specify the maximum size of the file up front. While you can set the VHD to be a fixed or dynamically sized file, the total size the VHD is determined at the time you create it. Over time, however, you may want to increase the total size of the VHD file as requirements for the system change to allow more space for installed programs and data files.</p>
<h2>Increasing the Size of the VHD File</h2>
<p>With the help of the freely available VHD Resizer tool, you can expand the size of a VHD using it’s simple wizard interface. When opening VHD Resizer the wizard prompts you for the source VHD file to resize.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image11.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb11.png" border="0" alt="image" width="600" height="407" /></a></p>
<p>After selecting the source, set a destination VHD to a new file.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image12.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb12.png" border="0" alt="image" width="491" height="451" /></a></p>
<p>This new file will be an exact copy of the source, only a larger size.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image13.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb13.png" border="0" alt="image" width="600" height="408" /></a></p>
<p>Once selected, set the new size of the destination VHD file. This will be the capacity of the new VHD. Once set, start the resizing process.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image14.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb14.png" border="0" alt="image" width="491" height="451" /></a></p>
<p>Depending on the size of the source and destination file, this can take some time.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image15.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb15.png" border="0" alt="image" width="491" height="451" /></a></p>
<p>Repeat the process for any additional VHD files.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image16.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb16.png" border="0" alt="image" width="279" height="182" /></a></p>
<h2>Resizing the Partition of the VHD Drive</h2>
<p>After resizing the VHD file, the extra space is recognized by the respective Windows installation as an unallocated partition. In order to assign this extra space to the system drive, we have to link the new VHD file to an existing VHD file and resize it within the virtual machine.</p>
<p>In an existing VHD file, such as the source, link the new VHD file as a second hard disk. This is done through the the properties of the virtual machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image17.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb17.png" border="0" alt="image" width="638" height="461" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image18.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb18.png" border="0" alt="image" width="599" height="451" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image19.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb19.png" border="0" alt="image" width="638" height="461" /></a></p>
<p>Once you have the new VHD linked as a secondary drive, start the respective virtual machine.</p>
<p>When you look at the Disk Management, you can see the additional space is unallocated.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image20.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb20.png" border="0" alt="image" width="666" height="397" /></a></p>
<p>In order to resize the system drive on the new VHD file, you use the Windows tool, Diskpart.</p>
<p>Within Diskpart, set the disk (usually disk 1) and respective partition (usually there is only one) and then issue the ‘extend’ command.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image21.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb21.png" border="0" alt="image" width="496" height="531" /></a></p>
<p>After the extend command of Diskpart has run, the previously unallocated space has been combined with the system drive to form a single larger drive.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image22.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb22.png" border="0" alt="image" width="666" height="397" /></a></p>
<p>Once you have resized the new drive, shut down the virtual machine you used to resize the new drive and then remove the new VHD file as the secondary drive.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image23.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb23.png" border="0" alt="image" width="638" height="461" /></a></p>
<p>The new VHD file is ready to use as it’s own virtual machine, so create a new VM based on the newly created file.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image24.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb24.png" border="0" alt="image" width="638" height="461" /></a></p>
<p>Once created, boot up the new virtual machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image25.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb25.png" border="0" alt="image" width="395" height="286" /></a></p>
<p>The new VHD file will now have a single drive with the new space available to use as needed.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image26.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb26.png" border="0" alt="image" width="552" height="322" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image27.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb27.png" border="0" alt="image" width="673" height="329" /></a></p>
<h2>Conclusion</h2>
<p>The ability to resize VHD files is tremendously useful. Since you can never predict what you may need in the future, you can build your VHD files with the size you know you need and then simply expand the size as needed.</p>
<h2>Links</h2>
<p><a href="http://vmtoolkit.com/files/folders/converters/entry87.aspx">Download VHD Resizer from VM Toolkit</a> (requires registration)</p>
<p><a href="http://support.microsoft.com/kb/300415">Microsoft documentation on Diskpart</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-resize-a-microsoft-virtual-hard-drive-vhd-file/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>When you create a Microsoft Virtual Hard Drive either through Virtual PC or Virtual Server, you have to specify the maximum size of the file up front. While you can set the VHD to be a fixed or dynamically sized file, the total size the VHD is determined at the time you create it. Over time, however, you may want to increase the total size of the VHD file as requirements for the system change to allow more space for installed programs and data files.</p>
<h2>Increasing the Size of the VHD File</h2>
<p>With the help of the freely available VHD Resizer tool, you can expand the size of a VHD using it’s simple wizard interface. When opening VHD Resizer the wizard prompts you for the source VHD file to resize.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image11.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb11.png" border="0" alt="image" width="600" height="407" /></a></p>
<p>After selecting the source, set a destination VHD to a new file.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image12.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb12.png" border="0" alt="image" width="491" height="451" /></a></p>
<p>This new file will be an exact copy of the source, only a larger size.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image13.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb13.png" border="0" alt="image" width="600" height="408" /></a></p>
<p>Once selected, set the new size of the destination VHD file. This will be the capacity of the new VHD. Once set, start the resizing process.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image14.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb14.png" border="0" alt="image" width="491" height="451" /></a></p>
<p>Depending on the size of the source and destination file, this can take some time.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image15.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb15.png" border="0" alt="image" width="491" height="451" /></a></p>
<p>Repeat the process for any additional VHD files.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image16.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb16.png" border="0" alt="image" width="279" height="182" /></a></p>
<h2>Resizing the Partition of the VHD Drive</h2>
<p>After resizing the VHD file, the extra space is recognized by the respective Windows installation as an unallocated partition. In order to assign this extra space to the system drive, we have to link the new VHD file to an existing VHD file and resize it within the virtual machine.</p>
<p>In an existing VHD file, such as the source, link the new VHD file as a second hard disk. This is done through the the properties of the virtual machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image17.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb17.png" border="0" alt="image" width="638" height="461" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image18.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb18.png" border="0" alt="image" width="599" height="451" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image19.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb19.png" border="0" alt="image" width="638" height="461" /></a></p>
<p>Once you have the new VHD linked as a secondary drive, start the respective virtual machine.</p>
<p>When you look at the Disk Management, you can see the additional space is unallocated.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image20.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb20.png" border="0" alt="image" width="666" height="397" /></a></p>
<p>In order to resize the system drive on the new VHD file, you use the Windows tool, Diskpart.</p>
<p>Within Diskpart, set the disk (usually disk 1) and respective partition (usually there is only one) and then issue the ‘extend’ command.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image21.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb21.png" border="0" alt="image" width="496" height="531" /></a></p>
<p>After the extend command of Diskpart has run, the previously unallocated space has been combined with the system drive to form a single larger drive.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image22.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb22.png" border="0" alt="image" width="666" height="397" /></a></p>
<p>Once you have resized the new drive, shut down the virtual machine you used to resize the new drive and then remove the new VHD file as the secondary drive.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image23.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb23.png" border="0" alt="image" width="638" height="461" /></a></p>
<p>The new VHD file is ready to use as it’s own virtual machine, so create a new VM based on the newly created file.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image24.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb24.png" border="0" alt="image" width="638" height="461" /></a></p>
<p>Once created, boot up the new virtual machine.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image25.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb25.png" border="0" alt="image" width="395" height="286" /></a></p>
<p>The new VHD file will now have a single drive with the new space available to use as needed.</p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image26.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb26.png" border="0" alt="image" width="552" height="322" /></a></p>
<p><a href="http://sysadmingeek.com/wp-content/uploads/2010/03/image27.png"><img style="border-width: 0px;" src="http://sysadmingeek.com/wp-content/uploads/2010/03/image_thumb27.png" border="0" alt="image" width="673" height="329" /></a></p>
<h2>Conclusion</h2>
<p>The ability to resize VHD files is tremendously useful. Since you can never predict what you may need in the future, you can build your VHD files with the size you know you need and then simply expand the size as needed.</p>
<h2>Links</h2>
<p><a href="http://vmtoolkit.com/files/folders/converters/entry87.aspx">Download VHD Resizer from VM Toolkit</a> (requires registration)</p>
<p><a href="http://support.microsoft.com/kb/300415">Microsoft documentation on Diskpart</a></p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-resize-a-microsoft-virtual-hard-drive-vhd-file/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/how-to-resize-a-microsoft-virtual-hard-drive-vhd-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to svn add All External Files to Subversion</title>
		<link>http://sysadmingeek.com/articles/how-to-svn-add-all-external-files-to-subversion/</link>
		<comments>http://sysadmingeek.com/articles/how-to-svn-add-all-external-files-to-subversion/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 00:00:47 +0000</pubDate>
		<dc:creator>The How-To Geek</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[keyboard-ninja]]></category>
		<category><![CDATA[source-control]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=835</guid>
		<description><![CDATA[<p>If you&#8217;re working on a project, and you&#8217;ve copied in or created a whole bunch of new files, you might find it tedious to manually add each of them. Here&#8217;s the quick command you can use instead:</p>
<blockquote><p><code>svn status &#124; grep "^\?" &#124; awk '{print $2}' &#124; xargs svn add</code></p></blockquote>
<p>The svn status part of the command will list out all changes, then we grep for the ? at the beginning of the line indicating that it&#8217;s an external file, then run it through awk to grab the filename, and finally pass the lot to svn add using xargs.</p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-svn-add-all-external-files-to-subversion/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re working on a project, and you&#8217;ve copied in or created a whole bunch of new files, you might find it tedious to manually add each of them. Here&#8217;s the quick command you can use instead:</p>
<blockquote><p><code>svn status | grep "^\?" | awk '{print $2}' | xargs svn add</code></p></blockquote>
<p>The svn status part of the command will list out all changes, then we grep for the ? at the beginning of the line indicating that it&#8217;s an external file, then run it through awk to grab the filename, and finally pass the lot to svn add using xargs.</p>
<p><br/><a href="http://sysadmingeek.com/articles/how-to-svn-add-all-external-files-to-subversion/" target='_blank'><img src="http://www.howtogeek.com/public/images/jointhediscussion.png" title="Got an opinion to share? Click here to join the discussion" alt="Got an opinion to share? Click here to join the discussion" border="0" /></a><br/></p>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/how-to-svn-add-all-external-files-to-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up AWStats on Windows Server and IIS</title>
		<link>http://sysadmingeek.com/articles/setting-up-awstats-on-windows-server-and-iis/</link>
		<comments>http://sysadmingeek.com/articles/setting-up-awstats-on-windows-server-and-iis/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 11:00:43 +0000</pubDate>
		<dc:creator>Jason Faulkner</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[web-servers]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server 2008]]></category>

		<guid isPermaLink="false">http://sysadmingeek.com/?p=526</guid>
		<description><![CDATA[<p>When it comes to gathering statistics on web sites, you can never have enough. While one of the most popular method for tracking statistics is through services such as Google Analytics, log file analysis remains a reliable way to track your visitors as they are immune to script blockers. A widely used tool for log file analysis is the open source tool, AWStats.</p>
<p>Before setting up AWStats, you will need to make sure Perl installed on your <a href="http://sysadmingeek.com/?p=500">Windows Server 2003/IIS 6</a> or <a href="http://sysadmingeek.com/?p=479">Windows Server 2008/IIS 7</a> machine.</p>
<h2>Configuring Web Site Logging</h2>
<p>In order to capture the data AWStats tracks, your sites must log the following fields:</p>
<ul>
<li>date</li>
<li>time</li>
<li>c-ip</li>
<li>cs-username</li>
<li>cs-method</li>
<li>cs-uri-stem</li>
<li>sc-status</li>
<li>sc-bytes</li>
<li>cs-version</li>
<li>cs(User-Agent)</li>
<li>cs(Referer)</li>
</ul>
<h3>IIS 6 Setup</h3>
<p>To configure logging in IIS 6, open IIS Manager and right click on the Web Sites folder and select Properties<em><p><a href="http://sysadmingeek.com/articles/setting-up-awstats-on-windows-server-and-iis/"><img src="http://www.howtogeek.com/geekers/up/readmore-button.png" border="0" /></a></p></em>]]></description>
			<content:encoded><![CDATA[<p>When it comes to gathering statistics on web sites, you can never have enough. While one of the most popular method for tracking statistics is through services such as Google Analytics, log file analysis remains a reliable way to track your visitors as they are immune to script blockers. A widely used tool for log file analysis is the open source tool, AWStats.</p>
<p>Before setting up AWStats, you will need to make sure Perl installed on your <a href="http://sysadmingeek.com/?p=500">Windows Server 2003/IIS 6</a> or <a href="http://sysadmingeek.com/?p=479">Windows Server 2008/IIS 7</a> machine.</p>
<h2>Configuring Web Site Logging</h2>
<p>In order to capture the data AWStats tracks, your sites must log the following fields:</p>
<ul>
<li>date</li>
<li>time</li>
<li>c-ip</li>
<li>cs-username</li>
<li>cs-method</li>
<li>cs-uri-stem</li>
<li>sc-status</li>
<li>sc-bytes</li>
<li>cs-version</li>
<li>cs(User-Agent)</li>
<li>cs(Referer)</li>
</ul>
<h3>IIS 6 Setup</h3>
<p>To configure logging in IIS 6, open IIS Manager and right click on the Web Sites folder and select Properties<em><p><a href="http://sysadmingeek.com/articles/setting-up-awstats-on-windows-server-and-iis/"><img src="http://www.howtogeek.com/geekers/up/readmore-button.png" border="0" /></a></p></em>]]></content:encoded>
			<wfw:commentRss>http://sysadmingeek.com/articles/setting-up-awstats-on-windows-server-and-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
