<?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>Jared Perry</title>
	<atom:link href="http://www.jaredperry.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jaredperry.ca</link>
	<description>My life as a System Administrator</description>
	<lastBuildDate>Tue, 06 Apr 2010 21:19:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Building Workstation Inventory</title>
		<link>http://www.jaredperry.ca/2010/04/building-workstation-inventory/</link>
		<comments>http://www.jaredperry.ca/2010/04/building-workstation-inventory/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 19:37:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[inventory]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.jaredperry.ca/?p=19</guid>
		<description><![CDATA[Do you currently have or need an inventory of devices on your network, including every detail about these devices? Well, if you have windows running on your workstations, then powershell could be of use. Powershell is now a built-in feature in Windows 7 and Server 2008R2, telling me it will be the standard for running [...]]]></description>
			<content:encoded><![CDATA[<p>Do you currently have or need an inventory of devices on your network, including every detail about these devices? Well, if you have windows running on your workstations, then powershell could be of use. Powershell is now a built-in feature in Windows 7 and Server 2008R2, telling me it will be the standard for running custom data mining and management scripts.</p>
<p>Powershell gives you an object oriented scripting language that allows for easy manipulation of data, for example where we are talking about getting device info, we can create a new WMI object that contains all the data about a computers BIOs very easily.</p>
<p style="padding-left: 30px;">PS C:\Documents and Settings\sysjared&gt; <em>$objBIOS = get-wmiobject -class Win32_BIOS</em><br />
PS C:\Documents and Settings\sysjared&gt; <em>$objBIOS</em></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 95px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SMBIOSBIOSVersion : A08</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 95px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Manufacturer      : Dell Inc.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 95px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Name              : Phoenix ROM BIOS PLUS Version 1.10 A08</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 95px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SerialNumber      : 6XR4871</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 95px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Version           : DELL   &#8211; 7</div>
<div style="padding-left: 30px;"><em>SMBIOSBIOSVersion : A08</em></div>
<div style="padding-left: 30px;"><em>Manufacturer : Dell Inc.</em></div>
<div style="padding-left: 30px;"><em>Name : Phoenix ROM BIOS PLUS Version 1.10 A08</em></div>
<div style="padding-left: 30px;"><em>SerialNumber : 6XR3476<br />
Version : DELL   &#8211; 7</em></div>
<div style="padding-left: 30px;"><em><br />
</em></div>
<div><em><span style="font-style: normal;">So as you can see, we can get a great deal of details using powershell and the builtin WMI object cmd-lets. We now have a way to get our computer details, the next step is how can we store this data? Well in my case I decided to use the<a title="MySQL .net connector" href="http://dev.mysql.com/downloads/connector/net/" target="_blank"> MySQL .net connector</a> which I have outlined in a previous post, and have created a database to be my device inventory. Now all you have to do is put a nice face on this database, I used <a title="CakePHP" href="http://cakephp.org/" target="_blank">cakePHP</a> to quickly deploy a simple management and inventory web interface.</span></em></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredperry.ca/2010/04/building-workstation-inventory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sysprep Troubles in Windows 7</title>
		<link>http://www.jaredperry.ca/2009/06/sysprep-troubles-in-windows-7/</link>
		<comments>http://www.jaredperry.ca/2009/06/sysprep-troubles-in-windows-7/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 16:26:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[sysprep]]></category>
		<category><![CDATA[unattend]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows media player]]></category>
		<category><![CDATA[wmp]]></category>

		<guid isPermaLink="false">http://www.jaredperry.ca/?p=33</guid>
		<description><![CDATA[Today I began the long journey of developing a deployment image of Windows 7. Before I started installing all the standard software that my organization uses I decided to test out the new version of sysprep. So I created an &#8220;autounattend.xml&#8221; file, it automatically installed then booted a fresh install of windows 7 into sysprep [...]]]></description>
			<content:encoded><![CDATA[<p>Today I began the long journey of developing a deployment image of Windows 7. Before I started installing all the standard software that my organization uses I decided to test out the new version of sysprep. So I created an &#8220;autounattend.xml&#8221; file, it automatically installed then booted a fresh install of windows 7 into sysprep audit mode. I decided I would install Microsoft Office as a test then generalize and reseal sysprep. After clicking the button to begin sysprep I got a nice little box saying sysprep was starting. Then out of no where *beep*, and I see a warning message from sysprep that a fatal error has occurred. At this point I decided to restart in hopes it would reenter audit mode, instead it no longer would boot.</p>
<p>After googling the error, I discovered a lot of people were having this issue and I also soon found the problem, Windows Media Player. I really can&#8217;t understand why Microsoft is infesting its media playing software into a fresh install of the OS. If you remember in the past WMP in a early leak of Windows 7 caused music files to be scanned and to have a small amount of data added to the beginning of these files, corrupting them. Now they have processes from this software, running and scanning your files even from a clean install without ever opening the program. Further they missed that it would cause difficulties with sysprep, and now I have to kill these processes or disable them from services, in order to get sysprep to function correctly.</p>
<p>Source: <a href="http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/8f5002e1-95b4-47bf-b031-4b72b3eb388a/">http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/8f5002e1-95b4-47bf-b031-4b72b3eb388a/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredperry.ca/2009/06/sysprep-troubles-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell and MySQL can be Friends</title>
		<link>http://www.jaredperry.ca/2009/06/powershell-and-mysql/</link>
		<comments>http://www.jaredperry.ca/2009/06/powershell-and-mysql/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 18:12:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[friends]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql.net]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[wmi]]></category>

		<guid isPermaLink="false">http://www.jaredperry.ca/?p=27</guid>
		<description><![CDATA[While using Powershell to collect data from a group of windows servers, I realized I would need a database to store the information collected. I was happy to learn that Powershell can utilize the MySQL.NET connector, so I could install MySQL on a server and have Powershell funnel the data with standard SQL commands into [...]]]></description>
			<content:encoded><![CDATA[<p>While using Powershell to collect data from a group of windows servers, I realized I would need a database to store the information collected. I was happy to learn that Powershell can utilize the MySQL.NET connector, so I could install MySQL on a server and have Powershell funnel the data with standard SQL commands into the database. All that I needed to do was install the .NET connector for MySQL on any machine I wished to connect to the database, in my case I installed it on all my servers. If you are worried about installing this connector, it has a small footprint and is nothing like some other database connectors like Oracles bulky ODBC driver. I have compiled a step by step list of how to configure and use MySQL within Powershell:</p>
<ol>
<li>Install MySQL.NET 5.0.9, there is newer versions, but I choose 5.0.9 because it works with all my scripts.
<ul>
<li>http://dev.mysql.com/downloads/connector/net/5.0.html</li>
</ul>
</li>
<li>If you are running a Powershell script as a task, you will need to change the execution policy in Powershell
<ul>
<li>Set-ExecutionPolicy unrestricted</li>
</ul>
</li>
<li>On servers if you want to run a Powershell script from a network share without prompt, you will need to add the share to Internet Explorers trusted sites list, apparently IE policy effects file share script execution</li>
<li>You will need to now load the connector into your powershell script, first is for 32-bit windows, the second is for 64-bit version of windows
<ul>
<li>[void][system.reflection.Assembly]::LoadFrom(&#8220;C:\Program Files\MySQL\MySQL Connector Net 5.0.9\Binaries\.NET 2.0\MySQL.Data.dll&#8221;)</li>
</ul>
<ul>
<li>[void][system.reflection.Assembly]::LoadFrom(&#8220;C:\Program Files (x86)\MySQL\MySQL Connector Net 5.0.9\Binaries\.NET 2.0\MySQL.Data.dll&#8221;)</li>
</ul>
</li>
<li>Now we will want to connect to our database
<ul>
<li>$dbconnect = New-Object MySql.Data.MySqlClient.MySqlConnection</li>
<li>$dbconnect.ConnectionString = &#8220;server=servername;user id=dbusername;password=dbpassword;database=dbname;pooling=false&#8221;</li>
<li>$dbconnect.Open()</li>
</ul>
</li>
<li>Once we have connected, we can now create a MySQL command object, below is an example SQL command
<ul>
<li>$sql = New-Object MySql.Data.MySqlClient.MySqlCommand</li>
<li>$sql.Connection = $dbconnect</li>
<li>$sql.CommandText = &#8220;INSERT INTO computer_details (computer_id, mac, dhcp, model, domain, manufacturer, type, memory, ip, servicetag, lastimagedate, servicepack, os, biosrev, scriptversion, lastrun, ou) VALUES (&#8216;$resultID&#8217;, &#8216;$macAddress&#8217;, &#8216;$dhcp&#8217;, &#8216;$model&#8217;, &#8216;$domain&#8217;, &#8216;$manufacturer&#8217;, &#8216;$systemType&#8217;, &#8216;$memory&#8217;, &#8216;$ipAddress&#8217;, &#8216;$servicetag&#8217;, NOW(), &#8216;$servicePack&#8217;, &#8216;$operatingSystem&#8217;, &#8216;$biosrev&#8217;, &#8216;$version&#8217;, NOW(), &#8216;$ou&#8217; )&#8221;</li>
<li>$sql.ExecuteNonQuery()</li>
<li>$dbconnect.Close()</li>
</ul>
</li>
</ol>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$sq= New-Object MySql.Data.MySqlClient.MySqlCommand</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$sql.Connection = $dbconnect</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#Insert our computer details using the above id and all the data from the WMI objects</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$sql.CommandText = &#8220;INSERT INTO computer_details (computer_id, mac, dhcp, model, domain, manufacturer, type, memory, ip, servicetag, lastimagedate, servicepack, os, biosrev, scriptversion, lastrun, ou) VALUES (&#8216;$resultID&#8217;, &#8216;$macAddress&#8217;, &#8216;$dhcp&#8217;, &#8216;$model&#8217;, &#8216;$domain&#8217;, &#8216;$manufacturer&#8217;, &#8216;$systemType&#8217;, &#8216;$memory&#8217;, &#8216;$ipAddress&#8217;, &#8216;$servicetag&#8217;, NOW(), &#8216;$servicePack&#8217;, &#8216;$operatingSystem&#8217;, &#8216;$biosrev&#8217;, &#8216;$version&#8217;, NOW(), &#8216;$ou&#8217; )&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$sql.ExecuteNonQuery()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#Here we are making sure the database connection closes as this script has finished doing what it needs to do at this time</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>$dbconnect.Close()</div>
<p>Using this example you can now easily collect data from your servers and insert it into a database. You can as well use any SQL statement you wish, including querying a database, and using Powershell to output/manipulate this data as needed. In future posts I will get into some examples of what I have done with powershell and mysql.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredperry.ca/2009/06/powershell-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modernizing Your File Systems</title>
		<link>http://www.jaredperry.ca/2009/06/modernizing-file-systems/</link>
		<comments>http://www.jaredperry.ca/2009/06/modernizing-file-systems/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 21:56:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[File Management]]></category>
		<category><![CDATA[745N]]></category>
		<category><![CDATA[dfs]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[redundancy]]></category>
		<category><![CDATA[robocopy]]></category>
		<category><![CDATA[server 2008]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.jaredperry.ca/?p=3</guid>
		<description><![CDATA[In August 2008, my boss came to me with a flaw in our infrastructure that had the potential to become a larger issue, and possibly disastrous to our organization if not addressed. The problem involved our main file server, we had a setup that had all clients connected to a windows server 2003 box to [...]]]></description>
			<content:encoded><![CDATA[<p>In August 2008, my boss came to me with a flaw in our infrastructure that had the potential to become a larger issue, and possibly disastrous to our organization if not addressed. The problem involved our main file server, we had a setup that had all clients connected to a windows server 2003 box to serve roaming profiles, user home directories and workgroup folders, as well as serve network apps, software installation files, music/video files, amoung other things. With so much load on this one server the issue that appeared was the server slowing down to a crawl, as well after upgrading the machines ram we had it crash several times randomly so we reverted to the old RAM. To compound these issues we had no server that could take its place if anything went wrong, system redundancy was placed on the RAID configuration which came with the Dell 745N PowerVault server. So we began assessing the following weaknesses in our file system:</p>
<ul>
<li>Software RAID configuration</li>
<li>Single server</li>
<li>Heavy, high bandwidth load (Upwards of 200 active clients, and hundreds of thousands of active files)</li>
<li>No backup/rescue scenarios</li>
<li>Outdated OS (Running windows server 2003 storage edition, Dell customized, this became an issue as it could not be updated and was severely lacking, feature and performance wise)</li>
<li>Reliability to the clients</li>
<li>Capacity limitations (1 Terabyte total, with over 600 gigs in use)</li>
</ul>
<p>To deal with these weaknesses, the whole file server setup needed to be revamped, while the existing setup ran in parallel. It was apparent that a new server was needed, Dell no longer supplied 745N PowerVault file servers, and were instead pushing expensive SAN systems, we wanted a low cost solution that had a great deal of redundancy and performance. So we looked at our existing server, and decided we would get the same server again, but where would be find the same model? Well ebay.</p>
<p>Ebay had a large listing of Dell 745N PowerVaults, all for under $1000, the server we finally choose had the fastest P4 possible 3.2ghz, 2 GB of ram,  4 x 250GB hard drives, and a hardware raid card (PERC 5\i). This solved one major problem, taking the raid management away from the OS and putting it on a dedicated RAID controller, as well we upgraded the RAM to 4GB, and increased hard drive space to 4 x 750GB. After receiving the server, we did the hardware upgrades, then came the next problem, what do we do with the old server 2003 storage edition OS? Well its 2008, and Microsoft had updated their OS, we wanted to use server 2008. However, if you have ever worked with a Dell PowerVault they lack a CD-ROM drive, and do not support any OS besides a USB installed version of server 2003. In the months before working on the storage issue, I was working with Windows Deployment, and utilizing its PXE boot feature, we could boot into a Vista PE environment. Then I copied the contents of our server 2008 installation disc onto a large flash drive, and from a command prompt I loaded up the setup.exe from the installation files. This is a fairly easy way to install modern versions of windows, you could even make a bootable usb drive to do the installation. Once into the installation wizard, I got as far as the disk configuration, then a road block, the raid setup was not detected. It took a while but we finally found the adaptec driver from a german Dell ftp. So now we had server 2008 installed, a machine with larger capacity then before, now 2 terabytes in hardware RAID 5.</p>
<p>After running our new server for a month, doing testing with the new OS, as well as load testing, we were ready for production. Then came the painful situation of moving all the data from the old file server to the new, without disruption. Using robocopy we copied each home directory, one by one, preserving the file attributes including time stamps, then updating each user AD object to the new server. Finally we moved the workgroups, and other miscellaneous files, leaving us with a fully operational file system, that was both up to date and redundant. Looking at our initial assessment we had crossed a lot off our list:</p>
<ul>
<li><span style="text-decoration: line-through;">Software RAID configuration</span></li>
<li>Single server</li>
<li>Heavy, high bandwidth load (Upwards of 200 active clients, and hundreds of thousands of active files)</li>
<li>No backup/rescue scenarios</li>
<li><span style="text-decoration: line-through;">Outdated OS (Running windows server 2003 storage edition, Dell customized, this became an issue as it could not be updated and was severely lacking, feature and performance wise)</span></li>
<li><span style="text-decoration: line-through;">Reliability to the clients</span></li>
<li><span style="text-decoration: line-through;">Capacity limitations (1 Terabyte total, with over 600 gigs in use)</span></li>
</ul>
<p>Still, we had a few more items to accomplish, and with our offices being spread across a university, the idea of a multisite file system soon took root. To build this system, we needed to upgrade the old server, find a load balancing/file replication technology, and find an alternate location. In upgrading the old server, we added a hardware RAID card which was special ordered from Dell for a 745N, apparently they still have 5 year old RAID cards ready for order. As well we upgraded the RAM, hard drives, and fully cleaned the server to be  similar to the Ebay purchased 745N. Next we updated the OS to server 2008, using the same method, and placed it in our main IT support office building, in a storage room. At that point we had two servers with similar specs, configurations, and separate locations, so all we needed was a piece of software that works with Windows, and can handle file replication/load balancing.</p>
<p>The software we decided to go with, was something that I had worked with a year before, it was built into Windows, Distributed File System (DFS). DFS is the underlying technology that is already used to replicate data/files between domain controllers, and has been integrated into Windows server for quite sometime. In server 2003, DFS was not as feature full as I would have liked, but it did show promise, for that reason I was willing to give it another try in server 2008. After initial testing, I had concluded that DFS had made many steps forward since server 2003, it had an easier to understand setup, added namespace and replication group features. So using DFS, I configured a domain namespace for user directories, workgroups, and profiles, these namespaces mean that a client would connect to the following type of share and it would then take that user and connect them to the regionally closest file server, all transparently. Namespace links can be used the same as any share, and look like this:</p>
<ul>
<li>\\domainname\users$</li>
<li>\\domainname\profiles$</li>
<li>\\domainname\workgroupname</li>
</ul>
<p>You can also use existing share names, which will act the same as a DFS namespace, pointing to one of the servers based on region, shares like:</p>
<ul>
<li>\\server1\users$
<ul>
<li>Points to which ever server is closest, or if no sites configured it will choose randomly:
<ul>
<li>Server1</li>
<li>Server2</li>
</ul>
</li>
</ul>
</li>
<li>\\server2\users$</li>
</ul>
<p>This made for a great setup, mainly if one server went offline, it would failover to the other server, and we can easily change or add new servers without changing the share name. With the shares taken care of, the next step before they could be enabled would be to replicate files so that they are the same on both servers, even if they are being constantly edited and opened. Using the file replication section of DFS, I separated each OU&#8217;s folders into replicating folders, and once completed we had a fully replicating group of servers. Of course there was issues, which are still being weeded out but they are minor, many include how some programs place locks on certain files. So far we have alleviated any issues quickly and they have not caused disruption.</p>
<p>In conclusion, if you are a small to medium sized organization, and are running an aging file system, you should consider looking at the options I have outlined. The older Dell Powervault line may seem out of date for modern operating systems, but in the correct setup they can work perfectly to quickly serve files, and can be stacked with cheap hard drives. When looking at storage systems, always have hardware RAID, and if possible have offsite backup or even multisite replication. Server 2008, is a necessary upgrade if you choose windows for your file systems, although it is based on Vista, it lacks the issues you encounter with that desktop OS. In future posts, I will get into further detail and provide greater instruction on configuring file systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaredperry.ca/2009/06/modernizing-file-systems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
