<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Noob Nuggets</title>
	<atom:link href="http://mcdrummerman.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mcdrummerman.wordpress.com</link>
	<description>some helpful info I found to be..uh....helpful</description>
	<lastBuildDate>Fri, 11 Nov 2011 00:51:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mcdrummerman.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Noob Nuggets</title>
		<link>http://mcdrummerman.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mcdrummerman.wordpress.com/osd.xml" title="Noob Nuggets" />
	<atom:link rel='hub' href='http://mcdrummerman.wordpress.com/?pushpress=hub'/>
		<item>
		<title>WIN32_FIND_DATA and negative file sizes.</title>
		<link>http://mcdrummerman.wordpress.com/2010/07/13/win32_find_data-and-negative-file-sizes/</link>
		<comments>http://mcdrummerman.wordpress.com/2010/07/13/win32_find_data-and-negative-file-sizes/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 20:26:07 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[C# .NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Win32 API]]></category>
		<category><![CDATA[Directory Info]]></category>
		<category><![CDATA[Negative file size]]></category>
		<category><![CDATA[pinvoke]]></category>
		<category><![CDATA[WIN32_FIND_DATA]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=155</guid>
		<description><![CDATA[UPDATE: Thanks to the comment from Bart, I found a problem with my approach. I used the pInvoke.net example in my code and they defined the nFileSizeHigh and nFileSizeLow as integers. This is why there was so much overflow. They should have been defined as unsigned int to allow for a greater range. I am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=155&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>UPDATE:  Thanks to the comment from Bart, I found a problem with my approach.  I used the pInvoke.net example in my code and they defined the nFileSizeHigh and nFileSizeLow as integers.  This is why there was so much overflow.  They should have been defined as unsigned int to allow for a greater range.  I am going to leave my solution untouched below because it worked and it is a good learning experience.  However if you ever need to use WIN32_FIND_DATA make sure you are using unsigned integers and the the MSDN solution should work fine.  Thanks again to Bart.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
ORIGINAL POST BEGINS:</p>
<p>I recently had the job of writing an application using the .NET Framework for work that would walk through the folders at a given location and return the total of all the file sizes so we can track changes in certain directories.  I quickly found out that the .NET Framework does not allow for folder paths that are beyond 260 characters and you get an <a href="http://msdn.microsoft.com/en-us/library/system.io.pathtoolongexception.aspx" target="_blank">exception if you try</a>.  Well that is a pain.</p>
<p><span id="more-155"></span>So working from an example from pinvoke.net(<a href="http://pinvoke.net/default.aspx/kernel32/FindFirstFile.html" target="_blank">read it here</a>) I started building an app based on the Windows API.  This was completely new territory for me and some surprises were encountered.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa365740%28VS.85%29.aspx" target="_blank">WIN32_FIND_DATA</a> is the data structure that is passed into the FindFirstFile and FindNextFile methods and is filled with the found files information.  The two properties I was examining were <strong> nFileSizeLow</strong> and <strong>nFileSizeHigh</strong> to get the file sizes.  But I noticed that for some files I was getting a negative file size returned.  Huh?!?</p>
<p>MSDN says that to get the correct file size you need to get the file size this way: (<strong>nFileSizeHigh</strong> *         (MAXDWORD+1)) + <strong>nFileSizeLow</strong></p>
<p>Tried that and still got negative file sizes.  WTF?  I tried a Google search to see if anyone had encountered this.  There were a few suggestions but after trying them I was still getting negative file sizes for really large files.  I finally found a solution that worked even when it encountered files that were 10GB in size.</p>
<p>Below is my explanation of the why and my solution.  This worked great for me but if any one encounters this and has suggestions please let me know in comments.  I figured this was worth the post since I haven&#8217;t seen this solution yet.</p>
<hr />
<p><span style="text-decoration:underline;">Explanation:</span></p>
<p>WIN32_FIND_DATA holds the file sizes in the <strong>nFileSizeLow</strong> property in bytes. <strong>nFileSizeHigh </strong>is meant to be greater than zero if the file size is greater than the data type can hold.  In this case the properties hold a DWORD, Windows version of a 32-bit <del datetime="2011-03-30T21:04:43+00:00">signed</del> unsigned integer (EDIT: originally this as incorrect).</p>
<div id="attachment_163" class="wp-caption alignleft" style="width: 310px"><a href="http://mcdrummerman.files.wordpress.com/2010/03/signed_int32_max.jpg"><img class="size-medium wp-image-163 " title="Signed_Int32_Max" src="http://mcdrummerman.files.wordpress.com/2010/03/signed_int32_max.jpg?w=300&#038;h=91" alt="" width="300" height="91" /></a><p class="wp-caption-text">1.1 The maximum of a signed 32-bit integer</p></div>
<p>The maximum for a signed 32-bit integer is (2^<sup>31) </sup>- 1 = 2,147,483,647.  Image 1.1 shows the bit pattern for this.<br />
So if we add one to this number we get the bit pattern that is shown in Image 1.2.<br />
We get the result of -2147483648 when we should get +2147483648.  To rectify this we need to add back in the correct value.  This would be 4294967296 or 2147483648 * 2.</p>
<div id="attachment_164" class="wp-caption alignleft" style="width: 310px"><a href="http://mcdrummerman.files.wordpress.com/2010/03/signed_int32_overflow.jpg"><img class="size-medium wp-image-164 " title="Signed_Int32_OverFlow" src="http://mcdrummerman.files.wordpress.com/2010/03/signed_int32_overflow.jpg?w=300&#038;h=92" alt="" width="300" height="92" /></a><p class="wp-caption-text">1.2 Overflowed 32-bit integer</p></div>
<p>There are four possible outcomes for WIN32_FIND_DATA&#8217;s file size info</p>
<p>1. nFileSizeLow &lt; 0 and nFileSizeHigh &gt; 0<br />
2. nFileSizeLow &gt; 0 and nFileSizeHigh &gt; 0<br />
3. nFileSizeLow &lt; 0 and nFileSizeHigh !&gt; 0<br />
4. nFilesSizeLow is &gt; 0</p>
<p>So MSDN&#8217;s solution does not account for all possibilities.  Below is my solution.</p>
<p>notes:</p>
<ul>
<li>4294967296 = [(AbsVal|32bit signed int max|)+1] * 2 = [([2^31]-1)+1] * 2 = 2147483648 * 2</li>
<li>+2147483647 = 32bit signed int max &#8212;&#8212;-&gt; 0111 1111 1111 1111</li>
<li>-2147483648 = 32bit signed int max + 1 &#8212;&gt; 1000 0000 0000 0000 &#8211;&gt; sign change! Should be <strong>+</strong>2147483648</li>
<li>-2147483648 + 2147483648 + 2147483648 = -2147483648 + (2147483648 * 2) = -2147483648 + 4294967296  = 2147483648 &#8211;&gt; sweet!</li>
</ul>
<hr />
<p>The WIN32_FIND_DATA struct looks like this:</p>
<pre>[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
 public struct WIN32_FIND_DATA
 {
 public FileAttributes dwFileAttributes;
 public FILETIME ftCreationTime;
 public FILETIME ftLastAccessTime;
 public FILETIME ftLastWriteTime;
 public int nFileSizeHigh; //EDIT: this should be a UINT, not INT
 public int nFileSizeLow; //EDIT: this should be a UINT, not INT
 public int dwReserved0; //EDIT: this should be a UINT, not INT
 public int dwReserved1; //EDIT: this should be a UINT, not INT
 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
 public string cFileName;
 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_ALTERNATE)]
 public string cAlternate;
 }</pre>
<p>I have declared this as findData below.</p>
<p><span style="text-decoration:underline;">My solution:</span></p>
<pre>//store nFileSizeLow
long fDataFSize = (long)findData.nFileSizeLow;

//store individual file size for later accounting usage
long fileSize = 0;

if (fDataFSize &lt; 0 &amp;&amp; (long)findData.nFileSizeHigh &gt; 0)
{
   fileSize = fDataFSize + 4294967296 + ((long)findData.nFileSizeHigh * 4294967296);
}
else
{
  if ((long)findData.nFileSizeHigh &gt; 0)
  {
     fileSize = fDataFSize + ((long)findData.nFileSizeHigh * 4294967296);
  }
  else if (fDataFSize &lt; 0)
  {
     fileSize = (fDataFSize + 4294967296);
  }
  else
  {
     fileSize = fDataFSize;
  }
}</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=155&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2010/07/13/win32_find_data-and-negative-file-sizes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>

		<media:content url="http://mcdrummerman.files.wordpress.com/2010/03/signed_int32_max.jpg?w=300" medium="image">
			<media:title type="html">Signed_Int32_Max</media:title>
		</media:content>

		<media:content url="http://mcdrummerman.files.wordpress.com/2010/03/signed_int32_overflow.jpg?w=300" medium="image">
			<media:title type="html">Signed_Int32_OverFlow</media:title>
		</media:content>
	</item>
		<item>
		<title>Add a printer for all users in Windows</title>
		<link>http://mcdrummerman.wordpress.com/2010/04/03/add-a-printer-for-all-users-in-windows/</link>
		<comments>http://mcdrummerman.wordpress.com/2010/04/03/add-a-printer-for-all-users-in-windows/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 20:24:43 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=121</guid>
		<description><![CDATA[So I was trying to figure out a way to add a network printer to a Windows machine so that it shows up for all users regardless of whether or not they have added it.  After some searching I found a command that could be run from the command line that would do the trick. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=121&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I was trying to figure out a way to add a network printer to a Windows machine so that it shows up for all users regardless of whether or not they have added it.  After some searching I found a command that could be run from the command line that would do the trick.</p>
<p>But it was pretty gnarly:</p>
<blockquote>
<pre>rundll32 printui.dll,PrintUIEntry /ga /n\\serverName\printerName</pre>
</blockquote>
<p>All options can be seen by using:</p>
<blockquote>
<pre>rundll32 printui.dll,PrintUIEntry /?</pre>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=121&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2010/04/03/add-a-printer-for-all-users-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>
	</item>
		<item>
		<title>MSN email and Evolution mail client setup.</title>
		<link>http://mcdrummerman.wordpress.com/2010/03/20/msn-email-and-evolution-mail-client-setup/</link>
		<comments>http://mcdrummerman.wordpress.com/2010/03/20/msn-email-and-evolution-mail-client-setup/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 21:23:35 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=172</guid>
		<description><![CDATA[Thanks to this post for this information.  I&#8217;ve collected it here in one place.  These are the sttings required for a new MSN inbox within the Evolution mail client.  Setup a new mailbox with these settings. Recieving Mail Tab: Server Type: POP (dropdown menu) Server: POP3.live.com Username: youremail@msn.com Security: SSL encryption Authentication Type: password the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=172&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://ubuntuforums.org/showthread.php?t=373739&amp;page=2">this post</a> for this information.  I&#8217;ve collected it here in one place.  These are the sttings required for a new MSN inbox within the Evolution mail client.  Setup a new mailbox with these settings.</p>
<p><span style="text-decoration:underline;"><strong>Recieving Mail Tab:</strong></span></p>
<p>Server Type: POP (dropdown menu)<br />
Server: POP3.live.com<br />
Username: <a href="mailto:youremail@msn.com">youremail@msn.com</a><br />
Security: SSL encryption<br />
Authentication Type: password<br />
the box to remember passord is checked.<span style="text-decoration:underline;"><strong> </strong></span></p>
<p>Server Type: SMTP (dropdown menu)<br />
Server:  smtp.live.com<br />
Server Requires Authentication (box is checked)<br />
Security: Use Secure Connection (TLS)<br />
Authentication Type: Login<br />
Username: <a href="mailto:youremail@msn.com">youremail@msn.com</a><br />
box to remember password is checked.</p>
<p>Worked for me.  Sending and receiving.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=172&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2010/03/20/msn-email-and-evolution-mail-client-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert a column number to a column name.  Java example.</title>
		<link>http://mcdrummerman.wordpress.com/2010/01/07/convert-a-column-number-to-a-column-name-java-example/</link>
		<comments>http://mcdrummerman.wordpress.com/2010/01/07/convert-a-column-number-to-a-column-name-java-example/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 16:42:21 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=146</guid>
		<description><![CDATA[In one of my classes we built a spreadsheet program using java.  One of the problems we had to figure out was how to access the columns.  In a spreadsheet the columns are referenced by letters: column A, column AAZ, etc.  Our underlying data structure consisted of array lists of array lists.  Obviously you can&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=146&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In one of my classes we built a spreadsheet program using java.  One of the problems we had to figure out was how to access the columns.  In a spreadsheet the columns are referenced by letters: column A, column AAZ, etc.  Our underlying data structure consisted of array lists of array lists.  Obviously you can&#8217;t reference a cell by a letter it has to be a zero based number reference.</p>
<p><span id="more-146"></span></p>
<p>So now you have to realize A is column 1 and Z is column 26.  AA is 27, AB is 28 and so on.  To access a certain column you need its number.  But you also need to  get a column name from a number.  This can be tricky.  The columns are one based, A=1, but the indices of the data structure underneath are zero based, A=0.</p>
<p>A Google search came up with plenty of examples but all that I found only worked in a certain range of numbers.  My buddy and I came up with the following algorithm that worked much nicer.  Below is the implementation in Java.  Casting to a char from an int in Java uses ASCII values.  You may need to play with this part of the example in other languages.</p>
<blockquote>
<pre>public String getColName (int colNum) {

   String res = "";

   int quot = colNum;
   int rem;        
    /*1. Subtract one from number.
    *2. Save the mod 26 value.
   *3. Divide the number by 26, save result.
   *4. Convert the remainder to a letter.
   *5. Repeat until the number is zero.
   *6. Return that bitch...
   */
    while(quot &gt; 0)
    {
        quot = quot - 1;
        rem = quot % 26;
        quot = quot / 26;
       
        //cast to a char and add to the beginning of the string
        //add 97 to convert to the correct ASCII number
        res = (char)(rem+97) + res;            
    }   
    return res;
}</pre>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=146&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2010/01/07/convert-a-column-number-to-a-column-name-java-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>
	</item>
		<item>
		<title>Page Up/Page Down doesn&#8217;t work correctly in Firefox</title>
		<link>http://mcdrummerman.wordpress.com/2009/02/27/page-uppage-down-doesnt-work-correctly-in-firefox/</link>
		<comments>http://mcdrummerman.wordpress.com/2009/02/27/page-uppage-down-doesnt-work-correctly-in-firefox/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 22:56:11 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=135</guid>
		<description><![CDATA[OK so I think this one is entirely my fault but it was still driving me nuts.  Whenever I tried to use the Page Up or Page Down key while viewing a web page in Firefox it would move the page down then almost immediately shoot back to where I was viewing before. In addition [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=135&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OK so I think this one is entirely my fault but it was still driving me nuts.  Whenever I tried to use the Page Up or Page Down key while viewing a web page in Firefox it would move the page down then almost immediately shoot back to where I was viewing before.</p>
<p>In addition to this using the arrow keys to move up and down was also a iffy prospect.  One day when I was low on sleep and using my computer this happened.  I had simply been ignoring it for so long.  I finally typed this sentence into Google search:</p>
<blockquote><p>firefox page up page down fuck</p></blockquote>
<p><span id="more-135"></span></p>
<p>And obviously I wasn&#8217;t the only one who was incredibly irritated by this because one of the first forum posts I read had my answer.</p>
<p><strong>Go to Tools&#8211;&gt;Options&#8211;&gt;Advanced&#8211;&gt;General.  Turn off the option to &#8220;Always use cursor keys to navigate within pages&#8221;.  Also try turning off the &#8220;Search for text when I start typing&#8221; option.</strong></p>
<p>After this your Page up/Down buttons should function like normal.  You can toggle between this caret browsing mode by simply hitting the F7 key.  And alternatively in Firefox you can page down with the Space bar and page up with Shift+Space bar.</p>
<p>I&#8217;m not sure if I was the one who enabled this function or it comes that way by default but whoever thought it was a good idea should be flogged.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=135&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2009/02/27/page-uppage-down-doesnt-work-correctly-in-firefox/feed/</wfw:commentRss>
		<slash:comments>91</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>
	</item>
		<item>
		<title>Active Directory Users and Computers Error: &#8220;the application has requested the runtime to terminate it in an unusual way&#8221;</title>
		<link>http://mcdrummerman.wordpress.com/2008/08/27/active-directory-users-and-computers-error-the-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way/</link>
		<comments>http://mcdrummerman.wordpress.com/2008/08/27/active-directory-users-and-computers-error-the-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 16:03:39 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Active Directory Users and Computers]]></category>
		<category><![CDATA[RSAT 64bit]]></category>
		<category><![CDATA[the application has requested the runtime to terminate]]></category>
		<category><![CDATA[Vista RSAT]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=105</guid>
		<description><![CDATA[UPDATE [6/19/2009]:  Below is my original fix for this problem however in the comments section frymaster provided an alternative.  I am no longer running Vista 64 so haven&#8217;t tested it but another user has confirmed it worked for him. Try deleting this file: %userprofile%\appdata\Roaming\Microsoft\MMC\dsa It will be recreated after you shut down your MMC console. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=105&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;"><strong>UPDATE [6/19/2009]:  Below is my original fix for this problem however in the comments section frymaster provided an alternative.  I am no longer running Vista 64 so haven&#8217;t tested it but another user has confirmed it worked for him.</strong></p>
<p style="text-align:left;"><strong>Try deleting this file:</strong></p>
<p style="text-align:left;"><strong>%userprofile%\appdata\Roaming\Microsoft\MMC\dsa</strong></p>
<p style="text-align:left;"><strong>It will be recreated after you shut down your MMC console.</strong></p>
<p style="text-align:left;"><strong>Thanks to frymaster for the update!</strong></p>
<hr /><strong>[Original Post]</strong></p>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">I installed the newest version of <a title="RSAT for Vista sp1" href="http://windowsvistablog.com/blogs/windowsvista/archive/2008/03/25/remote-server-administration-tools-rsat-now-available-for-windows-vista-sp1.aspx" target="_blank">RSAT</a> for Vista Service Pack 1.  I am running the 64-bit Version of Vista.</p>
<p style="text-align:left;">After installing this newest version I got this error when trying to start Active Directory Users and Computers:</p>
<blockquote>
<p style="text-align:left;">Microsoft Visual C++ Runtime Library<br />
&#8220;the application has requested the runtime to terminate it in an unusual way&#8221;</p>
<p style="text-align:center;"><a href="http://mcdrummerman.files.wordpress.com/2008/08/activedirectoryerror.jpg"><img class="size-full wp-image-107 aligncenter" src="http://mcdrummerman.files.wordpress.com/2008/08/activedirectoryerror.jpg?w=424&#038;h=201" alt="" width="424" height="201" /><span id="more-105"></span></a></p>
</blockquote>
<p style="text-align:left;">I could not find an answer anywhere, I was able to open up the Management Console (mmc.exe) and browse to the .msc file (dsa.msc) manually and it would open just fine.</p>
<p style="text-align:left;">I went looking for command line parameters for mmc.exe and here is what I found:</p>
<blockquote>
<h2 class="heading">MMC command-line options</h2>
<p>Using MMC command-line options, you can open a specific MMC console, open MMC in author mode, or specify that the 32-bit or 64-bit version of MMC is opened.</p>
<h4 class="subHeading">Syntax</h4>
<div class="subSection">
<p><strong>mmc</strong><em>path</em><strong>\</strong><em>filename.msc</em>[<strong>/a</strong>]  [<strong>/64</strong>] [<strong>/32</strong>]</div>
<h4 class="subHeading">Parameters</h4>
<div class="subSection">
<dl>
<dt><strong><em>path </em><strong>\ </strong><em>filename.msc </em></strong></dt>
<dd> Starts MMC and opens a saved console. You need to specify the complete path and file name for the saved console file. If you do not specify a console file, MMC opens a new console.</dd>
</dl>
<dl>
<dt><strong><strong>/a </strong></strong></dt>
<dd> Opens a saved console in author mode.  Used to make changes to saved consoles.</dd>
</dl>
<dl>
<dt><strong><strong>/64</strong></strong></dt>
<dd> Opens the 64-bit version of MMC (MMC64). Use this option only if you are running a Microsoft 64-bit operating system and want to use a 64-bit snap-in.</dd>
</dl>
<dl>
<dt><strong><strong>/32</strong></strong></dt>
<dd> Opens the 32-bit version of MMC (MMC32). When running a Microsoft 64-bit operating system, you can run 32-bit snap-ins by opening MMC with this command-line option when you have 32-bit only snap-ins.</dd>
</dl>
</div>
<ul>
<li> Source: <a href="http://technet.microsoft.com/en-us/library/cc757725.aspx" target="_blank">http://technet.microsoft.com/en-us/library/cc757725.aspx</a></li>
</ul>
</blockquote>
<p>The short cut for Active Directory Users and Computers points to:</p>
<blockquote><p>%SystemRoot%\system32\dsa.msc</p>
<p><a href="http://mcdrummerman.files.wordpress.com/2008/08/shortcut1.jpg"><img class="aligncenter size-full wp-image-109" src="http://mcdrummerman.files.wordpress.com/2008/08/shortcut1.jpg?w=370&#038;h=199" alt="" width="370" height="199" /></a></p></blockquote>
<p>Adding the &#8220;/64&#8243; flag to the Target of the shortcut fixed the problem</p>
<blockquote><p>%SystemRoot%\system32\dsa.msc /64</p>
<p><a href="http://mcdrummerman.files.wordpress.com/2008/08/shortcut2.jpg"><img class="aligncenter size-full wp-image-113" src="http://mcdrummerman.files.wordpress.com/2008/08/shortcut2.jpg?w=370&#038;h=201" alt="" width="370" height="201" /></a></p></blockquote>
<p>After that, no more errors!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcdrummerman.wordpress.com/105/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcdrummerman.wordpress.com/105/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=105&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2008/08/27/active-directory-users-and-computers-error-the-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>

		<media:content url="http://mcdrummerman.files.wordpress.com/2008/08/activedirectoryerror.jpg" medium="image" />

		<media:content url="http://mcdrummerman.files.wordpress.com/2008/08/shortcut1.jpg" medium="image" />

		<media:content url="http://mcdrummerman.files.wordpress.com/2008/08/shortcut2.jpg" medium="image" />
	</item>
		<item>
		<title>Get Members of an Active Directory Group Using Powershell</title>
		<link>http://mcdrummerman.wordpress.com/2008/08/11/get-members-of-an-active-directory-group-using-powershell/</link>
		<comments>http://mcdrummerman.wordpress.com/2008/08/11/get-members-of-an-active-directory-group-using-powershell/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 16:01:21 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=95</guid>
		<description><![CDATA[I use this one quite a lot because people always want to know who all is in an Active Directory Group.  Here is my quick and ugly Powershell script to find this info. $ldap = &#8220;your ldap path here&#8220; $de = new-object directoryservices.directoryentry(&#8220;LDAP://&#8221; + $ldap) $ds = new-object directoryservices.directorysearcher($de) $ds.filter = &#8216;(&#38;(samaccountname=*))&#8217; $rc = $ds.findall() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=95&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mcdrummerman.files.wordpress.com/2008/08/untitled.jpg"><img class="alignright size-medium wp-image-98" src="http://mcdrummerman.files.wordpress.com/2008/08/untitled.jpg?w=300&#038;h=115" alt="" width="300" height="115" /></a>I use this one quite a lot because people always want to know who all is in an Active Directory Group.  Here is my quick and ugly Powershell script to find this info.</p>
<p><span id="more-95"></span></p>
<blockquote><p>$ldap = &#8220;<span style="color:#ff9900;">your ldap path here</span>&#8220;<br />
$de = new-object directoryservices.directoryentry(&#8220;LDAP://&#8221; + $ldap)<br />
$ds = new-object directoryservices.directorysearcher($de)<br />
$ds.filter = &#8216;(&amp;(samaccountname=*))&#8217;<br />
$rc = $ds.findall()<br />
$rc[0].properties(&#8216;member&#8217;)</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcdrummerman.wordpress.com/95/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcdrummerman.wordpress.com/95/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=95&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2008/08/11/get-members-of-an-active-directory-group-using-powershell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>

		<media:content url="http://mcdrummerman.files.wordpress.com/2008/08/untitled.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>HP Director Won&#8217;t Start</title>
		<link>http://mcdrummerman.wordpress.com/2008/08/11/hp-director-wont-start/</link>
		<comments>http://mcdrummerman.wordpress.com/2008/08/11/hp-director-wont-start/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 14:57:48 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=92</guid>
		<description><![CDATA[I got a call at the Helpdesk today about a scanner in one of the faculty&#8217;s labs.  It was an HP 4570 Scanjet.  The scanner worked fine it was the software that came with it that was a problem. They wanted to use the HP Director software, which is fine it just wouldn&#8217;t start when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=92&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I got a call at the Helpdesk today about a scanner in one of the faculty&#8217;s labs.  It was an HP 4570 Scanjet.  The scanner worked fine it was the software that came with it that was a problem.</p>
<p><span id="more-92"></span>They wanted to use the HP Director software, which is fine it just wouldn&#8217;t start when you clicked on the program icon.  I was pretty stumped until I thought &#8220;Why not look at HP&#8217;s site?&#8221;  So I did.</p>
<p>And there it was a patch to fix this very problem (<a title="http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=oj-46104-1&amp;lc=en&amp;cc=us&amp;lang=en&amp;os=228&amp;product=77368&amp;dlc=en" href="http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=oj-46104-1&amp;lc=en&amp;cc=us&amp;lang=en&amp;os=228&amp;product=77368&amp;dlc=en" target="_blank">link</a>)</p>
<p>It turns out that IE 7 causes a problem.  Why??!?!  I have no idea but the patch fixed it.</p>
<p>Every once in a while I have to remind my self that the soultion is probably easier than I think AND someone else has already fixed it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcdrummerman.wordpress.com/92/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcdrummerman.wordpress.com/92/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=92&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2008/08/11/hp-director-wont-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>
	</item>
		<item>
		<title>Get an Active Directory Property from Powershell</title>
		<link>http://mcdrummerman.wordpress.com/2008/06/27/get-an-active-directory-property-from-powershell/</link>
		<comments>http://mcdrummerman.wordpress.com/2008/06/27/get-an-active-directory-property-from-powershell/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 22:33:26 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[Active Directory from Powershell]]></category>
		<category><![CDATA[Powershell script]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=76</guid>
		<description><![CDATA[In an earlier post I mentioned a useful link for Powershell users.  I am happy to say I used the cheat sheet today. Sometimes you want to grab a property from an Active Directory entry.  I wanted to be able to do it from Powershell. One of the cool things about PowerShell is that you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=76&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mcdrummerman.files.wordpress.com/2008/06/psscript.jpg"><img class="alignleft size-medium wp-image-77" src="http://mcdrummerman.files.wordpress.com/2008/06/psscript.jpg?w=300&#038;h=195" alt="" width="300" height="195" /></a>In an <a title="Powershell cheat sheet" href="http://mcdrummerman.wordpress.com/2008/06/27/powershell-cheat-sheet/" target="_blank">earlier post</a> I mentioned a useful link for Powershell users.  I am happy to say I used the cheat sheet today.</p>
<p>Sometimes you want to grab a property from an Active Directory entry.  I wanted to be able to do it from Powershell.</p>
<p>One of the cool things about PowerShell is that you can access the Namespaces in the .net framework.  So you can put together a script that can access Active Directory the same way you do it from .net Code using Directory Services.</p>
<p>Here is what I came up with:<span id="more-76"></span></p>
<blockquote><p>Write-Host <span style="color:#999999;">&#8220;&#8221;</span><br />
$id = Read-Host <span style="color:#999999;">&#8220;Which username?&#8221;</span><br />
$prop = Read-Host <span style="color:#999999;">&#8220;Which Property(Leave blank for all or type &#8216;list&#8217; for property names)?&#8221;</span></p>
<p>$de = <span style="color:#0000ff;">new</span>-object directoryservices.directoryentry(&#8220;LDAP://<span style="color:#ff9900;">your_LDAP_path</span>&#8220;)<br />
$ds = <span style="color:#0000ff;">new</span>-object directoryservices.directorysearcher($de)<br />
$ds.filter = &#8216;(&amp;(samaccountname=&#8217; + $id + &#8216;))&#8217;<br />
$results = $ds.findall()</p>
<p><span style="color:#0000ff;">if</span> ($prop -eq <span style="color:#999999;">&#8220;&#8221;</span>)<br />
{<br />
Write-Host <span style="color:#999999;">&#8220;&#8221;</span><br />
$results.item(0).properties | more<br />
}<br />
<span style="color:#0000ff;">elseif</span> ($prop -eq <span style="color:#999999;">&#8220;list&#8221;</span>)<br />
{<br />
Write-Host <span style="color:#999999;">&#8220;&#8221;</span><br />
$results.item(0).properties.propertynames | more<br />
}<br />
<span style="color:#0000ff;">else</span><br />
{<br />
Write-Host <span style="color:#999999;">&#8220;&#8221;</span><br />
$results.item(0).properties.item($prop)<br />
}<br />
Write-Host <span style="color:#999999;">&#8220;&#8221;</span><br />
Write-Host <span style="color:#999999;">&#8220;&#8221;</span></p></blockquote>
<p>So you just save this script as your_filename.ps1 and run it.</p>
<p>The LDAP filter is set to filter by the &#8220;samaccountname&#8221; which is usually the user name/id of the user.  If you wanted to filter by something else you could do so by changing the filter string.</p>
<p>After you run it you will be prompted for the variables and presto!  Some kick-assery ensues.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcdrummerman.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcdrummerman.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=76&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2008/06/27/get-an-active-directory-property-from-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>

		<media:content url="http://mcdrummerman.files.wordpress.com/2008/06/psscript.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Powershell Cheat Sheet</title>
		<link>http://mcdrummerman.wordpress.com/2008/06/27/powershell-cheat-sheet/</link>
		<comments>http://mcdrummerman.wordpress.com/2008/06/27/powershell-cheat-sheet/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 21:22:05 +0000</pubDate>
		<dc:creator>mcdrummerman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://mcdrummerman.wordpress.com/?p=63</guid>
		<description><![CDATA[Ever use Powershell?  I run into situations every once in a while where it is really useful but I always seem to forget the syntax.  I found a link to a really cool cheat sheet that I just tacked onto my wall so I won&#8217;t ever be lost again. Check it here: http://blogs.msdn.com/b/powershell/archive/2007/01/24/powershell-cheat-sheet.aspx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=63&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever use Powershell?  I run into situations every once in a while where it is really useful but I always seem to <a href="http://mcdrummerman.files.wordpress.com/2008/06/ps1.jpg"><img class="size-medium wp-image-65 alignright" src="http://mcdrummerman.files.wordpress.com/2008/06/ps1.jpg?w=300&#038;h=197" alt="" width="300" height="197" /></a>forget the syntax.  I found a link to a really cool cheat sheet that I just tacked onto my wall so I won&#8217;t ever be lost again.</p>
<p>Check it here: <a title="PS Cheat Sheet" href="http://blogs.msdn.com/b/powershell/archive/2007/01/24/powershell-cheat-sheet.aspx" target="_blank">http://blogs.msdn.com/b/powershell/archive/2007/01/24/powershell-cheat-sheet.aspx</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcdrummerman.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcdrummerman.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcdrummerman.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcdrummerman.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcdrummerman.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcdrummerman.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcdrummerman.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcdrummerman.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcdrummerman.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcdrummerman.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcdrummerman.wordpress.com&amp;blog=1283990&amp;post=63&amp;subd=mcdrummerman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcdrummerman.wordpress.com/2008/06/27/powershell-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/788ff3ba9e83fbc9e11ba00b0c785a75?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mcdrummerman</media:title>
		</media:content>

		<media:content url="http://mcdrummerman.files.wordpress.com/2008/06/ps1.jpg?w=300" medium="image" />
	</item>
	</channel>
</rss>
