<?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>Coretek Services</title>
	<atom:link href="http://www.coretekservices.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coretekservices.com</link>
	<description>Coretek Services</description>
	<lastBuildDate>Fri, 24 May 2013 14:45:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Powershell &#8211; Check for PS version and act accordingly&#8230;</title>
		<link>http://www.coretekservices.com/2013/05/23/powershell-check-for-ps-version-and-act-accordingly/</link>
		<comments>http://www.coretekservices.com/2013/05/23/powershell-check-for-ps-version-and-act-accordingly/#comments</comments>
		<pubDate>Thu, 23 May 2013 05:29:39 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4302</guid>
		<description><![CDATA[In recent posts, we&#8217;ve been outlining some important day-to-day differences in PowerShell CMDlets and features between v2 and v3.  And right now I&#8217;m working with a customer that is in the midst of transitioning between XP and Win7, and between Server 2003 and 2008/2012, where these differences really start to matter performance-wise.  So, we&#8217;ve got [...]]]></description>
				<content:encoded><![CDATA[<p>In recent posts, we&#8217;ve been outlining some important day-to-day differences in PowerShell CMDlets and features between v2 and v3.  And right now I&#8217;m working with a customer that is in the midst of transitioning between XP and Win7, and between Server 2003 and 2008/2012, where these differences really start to matter performance-wise. </p>
<p>So, we&#8217;ve got lots of PowerShell tools we wrote in v2 that we are slowly getting around to updating to the new features in v3.  But the thing is, we still can&#8217;t be certain where these scripts will be run, and by whom.  So we&#8217;ve put together a little &#8220;version detector&#8221; to help run the correct version of the command and give the best performance possible, whenever possible.  And as a result, you &#8212; the reader &#8212; can apply this type of thing to any script that might be run in a mixed environment.</p>
<p>This example below features the new <code>-Directory</code> flag in the PowerShell v3 <code>Get-ChildItem</code>, though you could just as easily replace that line in each section with any other CMDlet that behaves differently between versions.  Just modify this section, and wrap it around your CMDlet with the updated v3 capability&#8230;</p>
<p>&nbsp;</p>
<pre>$hostVersionInfo = (get-host).Version.Major
if ( $hostVersionInfo -eq "2" )
{
  # For PowerShell v2
  write "We appear to be using PS version $hostVersionInfo... That's okay, but this script processes faster with PS v3!"
  write ""
  $containers = Get-ChildItem -path $MoLoPath\$CurrentParent -recurse | ? {$_.psIscontainer -eq $true}
}
elseif ( $hostVersionInfo -eq "3" )
{
  # For PowerShell v3
  write "We appear to be using PS version $hostVersionInfo... Good!"
  write ""
  $containers = Get-ChildItem -Directory -path $MoLoPath -recurse
}
else
{ 
  write-host "Unknown/unapproved version of PowerShell. Exiting!"
  exit
}
</pre>
<p>&nbsp;</p>
<p>Normally, I&#8217;d explain some of the functionality in the script; but it&#8217;s fairly simple, well-commented, and in general pretty descriptive.  It just detects which version of PowerShell you&#8217;re running, and runs one of the two version of the CMDlet.  So you should be able to figure it out quickly even if you&#8217;re new to this stuff. </p>
<p>Of course, if you have a question (or have a better way of getting it done), feel free to comment. </p>
<p>So that&#8217;s it, I hope it helps!</p>
<p> <img src='http://www.coretekservices.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/05/23/powershell-check-for-ps-version-and-act-accordingly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell &#8211; Interactive Ping Test&#8230;</title>
		<link>http://www.coretekservices.com/2013/05/16/powershell-interactive-ping-test/</link>
		<comments>http://www.coretekservices.com/2013/05/16/powershell-interactive-ping-test/#comments</comments>
		<pubDate>Thu, 16 May 2013 05:39:09 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4326</guid>
		<description><![CDATA[Here&#8217;s a fun, goofy little PowerShell script for you.  Last week Matt and I were working on a &#8220;Go-Live&#8221; event &#8212; where every moment is part of a timed, scripted series of steps &#8212; and one of Matt&#8217;s critical remote workstations crashed.  Matt had to move on to other tasks while waiting for the machine [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a fun, goofy little PowerShell script for you. </p>
<p>Last week Matt and I were working on a &#8220;Go-Live&#8221; event &#8212; where every moment is part of a timed, scripted series of steps &#8212; and one of Matt&#8217;s critical remote workstations crashed.  Matt had to move on to other tasks while waiting for the machine to come back up, but in that waning moment we wondered to each other&#8230; &#8220;In all the PowerShell scripts and tools we&#8217;ve written, how is it that we never wrote a &#8216;Host Up&#8217; notification script?&#8221;</p>
<p>Well, we can&#8217;t let that stand.  So we began to devise the scripts in our heads, and later that evening I scratched it down so that we&#8217;d have it next time. </p>
<p>&nbsp;</p>
<pre>$MyRemoteHost = "8.8.8.8"
$MyFlag = "False"
while ($MyFlag -eq "False")
{
  $MyResult = ping -n 1 $MyRemoteHost |findstr /C:"Reply "
  if ($MyResult -ne $null)
  {
    #write "$MyRemoteHost is up!"
    #Or do something cool here...
    $LoadStatement = [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $MyInput = [System.Windows.Forms.MessageBox]::Show("$MyRemoteHost is up.  Do you want to EXIT?","Yuuup!","YesNo","Warning")
    if ($MyInput -eq "YES")
    {
      break
    }
  }
  Start-Sleep 5
}

</pre>
<p>&#8230;why?  Just because we can.</p>
<p> <img src='http://www.coretekservices.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/05/16/powershell-interactive-ping-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sarah, The Team, and the &#8220;Walk For Wishes&#8221;&#8230;</title>
		<link>http://www.coretekservices.com/2013/05/09/sarah-and-the-walk-for-wishes/</link>
		<comments>http://www.coretekservices.com/2013/05/09/sarah-and-the-walk-for-wishes/#comments</comments>
		<pubDate>Thu, 09 May 2013 05:12:43 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[Announcement]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4313</guid>
		<description><![CDATA[It all started simply enough &#8212; fellow Coreteker Sarah Roland sent out an email mentioning that she was starting out a Coretek walking team for the &#8220;Walk For Wishes&#8221; event, and asked for anyone to join or support her in her effort.  The Southeast Michigan Walk for Wishes 2013 event was to be held at [...]]]></description>
				<content:encoded><![CDATA[<p>It all started simply enough &#8212; fellow Coreteker Sarah Roland sent out an email mentioning that she was starting out <a title="https://www.kintera.org/faf/search/searchTeamPart.asp?ievent=1042801&amp;team=5458647" href="https://www.kintera.org/faf/search/searchTeamPart.asp?ievent=1042801&amp;team=5458647" target="_blank">a Coretek walking team</a> for <a title="https://www.kintera.org/faf/home/default.asp?ievent=1042801" href="https://www.kintera.org/faf/home/default.asp?ievent=1042801" target="_blank">the &#8220;Walk For Wishes&#8221; event</a>, and asked for anyone to join or support her in her effort.  The Southeast Michigan Walk for Wishes 2013 event was to be held at the Detroit Zoo, in support of the <a title="https://www.wishmich.org/" href="https://www.wishmich.org/" target="_blank">Make-A-Wish Michigan foundation</a>. </p>
<p>Upon seeing the email, I immediately thought of my wife, who had done some charity-focused walks in the past, and forwarded the email.  She loved the idea, and immediately joined in. </p>
<p>Fast-forward to a sunny,  wonderful Saturday May 4th at the Detroit Zoo where 3000 of our closest friends came out to help raise more than $345,000, and had a great time doing it.  And Sarah&#8217;s little Coretek team even raised over $500 in the process &#8212; not bad! </p>
<p>And once we arrived on the morning of the walk, the kids and I could not resist either, and jumped in with Sarah&#8217;s family, making it a two-family team.  Sarah&#8217;s son was an excellent zoo tour guide!  We had great time all the way through.  Here&#8217;s a pic of some of our team crossing the finish line&#8230;</p>
<p><a href="http://www.coretekservices.com/wp-content/uploads/2013/05/walkForWishesFinish.jpg"><img class="aligncenter size-medium wp-image-4314" alt="walkForWishesFinish" src="http://www.coretekservices.com/wp-content/uploads/2013/05/walkForWishesFinish-300x225.jpg" width="300" height="225" /></a></p>
<p>It ended all-too fast, and wrapped up with a nice celebration ceremony and lunch.  Afterward, we made our way back through the zoo afterward just to see some more sights at a little more of a leisurely pace.</p>
<p>All in all: great enthusiasm, a great zoo, great company, great food, and of course, a great cause. </p>
<p>Thanks to Sarah for putting it together, and thanks to many of you reading this for donating.</p>
<p>See you there next year!</p>
<p> <img src='http://www.coretekservices.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/05/09/sarah-and-the-walk-for-wishes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Earth Day Reflection, 2013&#8230;</title>
		<link>http://www.coretekservices.com/2013/04/24/earth-day-reflection-2013/</link>
		<comments>http://www.coretekservices.com/2013/04/24/earth-day-reflection-2013/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 02:37:16 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[earth day]]></category>
		<category><![CDATA[re-Source Partners]]></category>
		<category><![CDATA[recycle]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4296</guid>
		<description><![CDATA[As you may recall, last year the folks at my &#60;un-named customer location&#62; graciously permitted me to participate in their Earth Day recycling &#8220;event&#8221;.  During this event, the organization encourages the employees to bring in certain items to recycle, which are picked up and utilized by nearby recycling organizations.  This year, the supporting organizations again [...]]]></description>
				<content:encoded><![CDATA[<p>As you may recall, last year <a title="http://www.coretekservices.com/2012/04/26/earth-day-reflection/" href="http://www.coretekservices.com/2012/04/26/earth-day-reflection/" target="_blank">the folks at my &lt;<em>un-named customer location</em>&gt; graciously permitted me to participate in their Earth Day recycling &#8220;event&#8221;</a>.  During this event, the organization encourages the employees to bring in certain items to recycle, which are picked up and utilized by nearby recycling organizations.  This year, the supporting organizations again included those that accept old eyeglasses, old mobile phones for soldiers, etc., as well as computer component recycling by local organization re-Source Partners. </p>
<p>No matter what your opinion of &#8220;Earth Day&#8221; itself, I think it&#8217;s a great idea to utilize this day in a way that fits your motivations.  As I&#8217;ve mentioned before, I don&#8217;t think it matters as much *why* you do good things, as it does that you just *do*.  So in my busy life, I think it&#8217;s great to have these sorts of reminders to make at least a tiny donation (like the eyeglasses, phones, etc.), especially when the stuff doesn&#8217;t even matter to you any more.  Even recycling old computer junk with organizations like this can be considered a &#8220;donation&#8221; when you think about all the componentry and raw material that will be scavenged from the old computer hardware and returned to usefulness in new products; so much better than filling up a land fill!</p>
<p> <a href="http://www.coretekservices.com/wp-content/uploads/2013/04/EarthDay2013.png"><img class="aligncenter size-medium wp-image-4298" alt="EarthDay2013" src="http://www.coretekservices.com/wp-content/uploads/2013/04/EarthDay2013-300x231.png" width="300" height="231" /></a>This year, while my part was fairly small (my mother&#8217;s old PC and monitor, 2 of my wife&#8217;s old laptops, 2 desktops I got off eBay fro Dev/Testing, and 2 Intel clone servers that served me well), I took a moment to reflect on a couple things:</p>
<ol>
<li>Even though these are all *working* computers and parts, all of the computing power &#8212; combined &#8212; is still just a fraction of just ONE of my Virtual Machine hosts that replaced them</li>
<li>It&#8217;s a tiny piece of &#8220;mess&#8221; in my basement that can&#8217;t and won&#8217;t be re-made; these types of computer components are just not seen as much anymore (and certainly will not be seen in my home anymore) as smartphones, tablets, and other modern devices (and cloud services) have pretty much replaced the need for these things</li>
</ol>
<p>So that&#8217;s all the good news&#8230;  The bad news is that my basement still has a ton more of this old hardware.</p>
<p> <img src='http://www.coretekservices.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>But I hope Earth Day 2013 helped you in some way, too.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/04/24/earth-day-reflection-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell &#8211; How recursive directory searches got better with PSv3&#8230;</title>
		<link>http://www.coretekservices.com/2013/04/18/powershell-how-recursive-directory-searches-got-better-with-psv3/</link>
		<comments>http://www.coretekservices.com/2013/04/18/powershell-how-recursive-directory-searches-got-better-with-psv3/#comments</comments>
		<pubDate>Thu, 18 Apr 2013 05:16:32 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[-Directory]]></category>
		<category><![CDATA[Get-ChildItem]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShellv2]]></category>
		<category><![CDATA[PowerShellv3]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4284</guid>
		<description><![CDATA[In the old days, we ate dirt for dinner, brushed our teeth with sticks, used PowerShell v2 &#8212; and we *liked* it!  There, that&#8217;s my tribute to Dana Carvey as &#8220;Grumpy Old Man&#8221;.  Google it, kids. Anyway, I&#8217;ve got an absolute ton of old PowerShell scriptlets that I have lying about that I regularly cannibalize [...]]]></description>
				<content:encoded><![CDATA[<p>In the old days, we ate dirt for dinner, brushed our teeth with sticks, used PowerShell v2 &#8212; and we *liked* it! </p>
<p>There, that&#8217;s my tribute to Dana Carvey as &#8220;Grumpy Old Man&#8221;.  Google it, kids.</p>
<p>Anyway, I&#8217;ve got an absolute ton of old PowerShell scriptlets that I have lying about that I regularly cannibalize or resuscitate back into production.  And since we are in that squishy transitional period between PowerShell v2 and v3, I don&#8217;t always bother to check them for compatibility with v3 or update features in the script to take advantage of new capabilities.  But I hit on one v3 improvement the other day that solved a problem has bugged me so much for so long that I wanted to shout from the mountaintops about it!  And since I live in mostly-mountainless Michigan, the blog is the best I can do&#8230;</p>
<p>Really it&#8217;s such a little thing.  But it&#8217;s so overdue.</p>
<p>In the past, if you wanted to recursively inspect a folder structure on a remote server &#8212; for instance while fishing for explicit NTFS permissions on folders &#8212; you were forced to inspect all folders *and* files, no matter if you only wanted folders.  Basically, you had to ask for everything (all children folders and files, recursively), then parse the result to extract the folders (check psIsContainer) from the listing.  Here&#8217;s an example of this, similar to what you might see all around the internet:</p>
<pre># For PowerShell v2
$containers = Get-ChildItem -path $TopPath\$CurrentParent -recurse | ? {$_.psIscontainer -eq $true}</pre>
<p> Of course, this could be incredibly wasteful in processing, network bandwidth, time, etc&#8230;   All this time I&#8217;ve always wished there was a way in my loops to just ask for ONLY the folders, to save all of that waste.  Thankfully, this has arrived with v3.  Behold:</p>
<pre># For PowerShell v3
$containers = Get-ChildItem -Directory -path $TopPath\$CurrentParent -recurse</pre>
<p> This has significantly sped up some of my analysis scripts that I run in a large enterprise, cutting as much as half a day off of some of my execution times (I did mention it was large).  So really what this means is that I have to start spending more spare time looking through the v2/v3 differences&#8230;  But I won&#8217;t have any spare time until I implement more v3 changes&#8230;  Quite a conundrum&#8230; </p>
<p> <img src='http://www.coretekservices.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/04/18/powershell-how-recursive-directory-searches-got-better-with-psv3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A cool &#8216;Remote Desktop Connection Manager&#8217; tip!</title>
		<link>http://www.coretekservices.com/2013/04/04/a-cool-remote-desktop-connection-manager-tip/</link>
		<comments>http://www.coretekservices.com/2013/04/04/a-cool-remote-desktop-connection-manager-tip/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 05:41:46 +0000</pubDate>
		<dc:creator>Matthew Sharland</dc:creator>
				<category><![CDATA[Desktop OS]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Virtual Desktop Management]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Workstation Management]]></category>
		<category><![CDATA[rdp]]></category>
		<category><![CDATA[Remote]]></category>
		<category><![CDATA[Remote Desktop Connection Manager]]></category>
		<category><![CDATA[Remote Desktop View]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4194</guid>
		<description><![CDATA[I am constantly monitoring multiple Microsoft Windows Servers and XP workstations via Remote Desktop Connection Manager and having to switch between each console one at a time is a very user-intensive and time-consuming process.  Though, I have recently discovered a very useful and time-saving trick that I will share with you below&#8230; First, by default, the Remote [...]]]></description>
				<content:encoded><![CDATA[<p>I am constantly monitoring multiple Microsoft Windows Servers and XP workstations via <a title="Remote Desktop Connection Manager" href="http://www.microsoft.com/en-us/download/details.aspx?id=21101" target="_blank">Remote Desktop Connection Manager</a> and having to switch between each console one at a time is a very user-intensive and time-consuming process.  Though, I have recently discovered a very useful and time-saving trick that I will share with you below&#8230;</p>
<p>First, by default, the Remote Desktop Connection Manager gives you a thumbnail view of all of your workstations when you click on any &#8220;group&#8221; of servers from the left server pane list.  I always thought this was a &#8220;gimmick&#8221; and never thought twice about using it for anything because the dimensions of the thumbnail views of the remote desktops were just way too small to be useful.</p>
<p>But after reviewing the program&#8217;s options I found that you can modify the size of the thumbnails (Tools &gt; Options &gt; Client Area &gt; Thumbnail Size)!</p>
<p>But that isn&#8217;t all!</p>
<p>The thumbnails are actual &#8220;live&#8221; clickable Remote Desktop sessions; so if you set the pixel size of the thumbnails to 25%, 30% or 40% of your screen size, you can fit 4-12 active server connections into one <strong>very productive</strong> <strong>window</strong> (obviously depending on your monitor size and screen resolution!).  This screen cap should give you a good idea of what I mean:</p>
<p style="text-align: center;"><a href="http://www.coretekservices.com/wp-content/uploads/2013/04/screenshot.jpg"><img class="aligncenter  wp-image-4269" alt="screenshot" src="http://www.coretekservices.com/wp-content/uploads/2013/04/screenshot-1024x509.jpg" width="717" height="356" /></a></p>
<p>&nbsp;</p>
<p>I hope you find this tip as useful as I did!  Enjoy!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/04/04/a-cool-remote-desktop-connection-manager-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing HKCU keys using a Windows Installer repair, Pt. II</title>
		<link>http://www.coretekservices.com/2013/03/28/installing-hkcu-keys-using-a-windows-installer-repair-pt-ii/</link>
		<comments>http://www.coretekservices.com/2013/03/28/installing-hkcu-keys-using-a-windows-installer-repair-pt-ii/#comments</comments>
		<pubDate>Thu, 28 Mar 2013 06:32:36 +0000</pubDate>
		<dc:creator>Paul Opper</dc:creator>
				<category><![CDATA[Application Packaging]]></category>
		<category><![CDATA[Desktop Management]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Application Delivery]]></category>
		<category><![CDATA[msi]]></category>
		<category><![CDATA[Windows Installer]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4165</guid>
		<description><![CDATA[Previously, in Pt. I of this series, I wrote about how to install HKCU registry keys (which can also be used for installing data anywhere in a user profile).  Now I&#8217;ll go into more depth on how to do this using the popular application packaging product Wise Package Studio. Though Wise Package Studio has been [...]]]></description>
				<content:encoded><![CDATA[<p>Previously, in <a title="http://www.coretekservices.com/2013/03/14/installing-hkcu-keys-using-a-windows-installer-repair/" href="http://www.coretekservices.com/2013/03/14/installing-hkcu-keys-using-a-windows-installer-repair/" target="_blank">Pt. I of this series</a>, I wrote about how to install HKCU registry keys (which can also be used for installing data anywhere in a user profile).  Now I&#8217;ll go into more depth on how to do this using the popular application packaging product Wise Package Studio.</p>
<p><span style="font-size: 13px;">Though Wise Package Studio has been </span><a style="font-size: 13px;" href="http://www.symantec.com/theme.jsp?themeid=wise-package-studio-migration">discontinued by Symantec</a><span style="font-size: 13px;">, it&#8217;s still quite popular in many packaging environments.  The main tool used for creating and editing Windows Installer projects in Wise Package Studio is the &#8220;Windows Installer Editor&#8221;, which was previously available alone as &#8220;Wise for Windows Installer&#8221; (wfwi.exe). </span></p>
<p>Most of the packaging work will be done in the &#8220;Installation Expert&#8221; view, which is a slightly more &#8220;user friendly&#8221; or &#8220;cleaner&#8221; project editor.  After creating my new project, I&#8217;ll add a couple files to it.  The files I added are Process Explorer (procexp.exe) from &#8220;SysInternals&#8221; and it&#8217;s help file (procexp.chm).  Process Explorer is one of several extremely useful utilities available (free!) in the <a href="http://technet.microsoft.com/en-us/sysinternals/bb842062">Sysinternals Suite</a>. </p>
<p>&nbsp;</p>
<p><a href="http://www.coretekservices.com/wp-content/uploads/2013/03/1.Wise_.png"><img class="aligncenter size-large wp-image-4187" alt="1.Wise" src="http://www.coretekservices.com/wp-content/uploads/2013/03/1.Wise_-1024x550.png" width="1024" height="550" /></a></p>
<p>&nbsp;</p>
<p>Next, I&#8217;ll add an &#8220;Advertised&#8221; desktop shortcut to &#8220;procexp.exe&#8221; from the &#8220;Shortcuts&#8221; page.  By default, when you add a shortcut to point to a file in your installation the &#8220;Advertised&#8221; check box is marked. </p>
<p>&nbsp;</p>
<p><a href="http://www.coretekservices.com/wp-content/uploads/2013/03/2.Wise_.png"><img class="aligncenter size-large wp-image-4188" alt="2.Wise" src="http://www.coretekservices.com/wp-content/uploads/2013/03/2.Wise_-1024x592.png" width="1024" height="592" /></a></p>
<p>&nbsp;</p>
<p>Note that &#8220;Complete&#8221; is listed in the &#8220;Current Feature&#8221; drop down list.  By default, Wise starts with a feature named &#8220;Complete&#8221; and puts all files, registry keys, shortcuts, etc. under the &#8220;Complete&#8221; feature, but we need a &#8220;hidden&#8221; parent feature.  So, from the Features page &#8220;Add&#8221; a new feature.  Give it a name, select &#8220;&lt;None&gt;&#8221; from the Parent drop down list, &#8220;Hidden&#8221; from the Display drop down, and check the &#8220;Required Feature&#8221; check box; the rest of the defaults can be left.  After adding the hidden parent feature, I go into the &#8220;Complete&#8221; feature to select the hidden feature from its &#8220;Parent&#8221; drop down list. </p>
<p>&nbsp;</p>
<p><a href="http://www.coretekservices.com/wp-content/uploads/2013/03/3.Wise_.png"><img class="aligncenter size-full wp-image-4189" alt="3.Wise" src="http://www.coretekservices.com/wp-content/uploads/2013/03/3.Wise_.png" width="445" height="434" /></a></p>
<p>&nbsp;</p>
<p>Finally, I add an HKCU registry key to the new hidden feature.  Notice now that I&#8217;ve added a new feature, I can select it from the &#8220;Current Feature&#8221; drop down list from all the pages in Installation Expert. </p>
<p>&nbsp;</p>
<p><a href="http://www.coretekservices.com/wp-content/uploads/2013/03/4.Wise_.png"><img class="aligncenter size-large wp-image-4190" alt="4.Wise" src="http://www.coretekservices.com/wp-content/uploads/2013/03/4.Wise_-1024x509.png" width="1024" height="509" /></a></p>
<p>&nbsp;</p>
<p><span style="font-size: 13px;">After the project is compiled, the .MSI can be run on any system &#8220;per machine&#8221; with the &#8220;ALLUSERS&#8221; value set to &#8217;1&#8242;.  When a new user logs onto the machine and clicks on the advertised shortcut, the HKCU key will be installed by the windows installer repair. </span></p>
<p> Next time, I&#8217;ll take a look at implementing self repair using InstallShield.  I hope you found this tutorial enlightening, instructive, and maybe even a little fun.  Well..uh..instructive and enlightening should be good enough! </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/03/28/installing-hkcu-keys-using-a-windows-installer-repair-pt-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell &#8211; Query Active Directory for Server Versions&#8230;</title>
		<link>http://www.coretekservices.com/2013/03/21/powershell-query-active-directory-for-server-versions/</link>
		<comments>http://www.coretekservices.com/2013/03/21/powershell-query-active-directory-for-server-versions/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 05:45:57 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Export-CSV]]></category>
		<category><![CDATA[Get-AdComputer]]></category>
		<category><![CDATA[LDAPFilter]]></category>
		<category><![CDATA[nslookup]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShellv2]]></category>
		<category><![CDATA[PowerShellv3]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[UTF8]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4157</guid>
		<description><![CDATA[Today, I&#8217;m writing about a simple-but-useful command that just might help you get a better understanding of the quantity and variety of Windows servers you have in your environment, with just a few caveats.  The most accurate way to get such information, of course, is to query Active Directory in real-time to get the most [...]]]></description>
				<content:encoded><![CDATA[<p>Today, I&#8217;m writing about a simple-but-useful command that just might help you get a better understanding of the quantity and variety of Windows servers you have in your environment, with just a few caveats.  The most accurate way to get such information, of course, is to query Active Directory in real-time to get the most current information possible.  And the easiest way to do that (in my opinion), is to use PowerShell.  So launch a console and let&#8217;s get to it&#8230;</p>
<p>But first, if you haven&#8217;t launched the pre-loaded Active-Directory PowerShell Module, then let&#8217;s do that now:</p>
<pre>Import-Module ActiveDirectory</pre>
<p>Here&#8217;s a first blush at how we can list all AD-based computers, grabbing only the interesting properties we need, formatting the output to a list, and redirecting the results to file (I&#8217;ve seen some things like this while &#8216;Googling):</p>
<pre>Get-AdComputer -Filter * -Properties IPv4Address,OperatingSystem,OperatingSystemServicePack | Format-List Name, IPv4Address, OperatingSystem* &gt; OutputServerList.txt</pre>
<p>Now, let&#8217;s dig deeper, and perhaps refine the command a bit.  First, the filter is a wildcard, and retrieves all computers.  That might be fine in a small environment with few computers; but we&#8217;re really only after Servers here, and we might be working in a larger environment.  So, we will change the filter to use an LDAPFilter and get a bit more granular like this:</p>
<pre>-LDAPFilter "(OperatingSystem=*Server*)"</pre>
<p>Next, I think the results will actually look better if we output them to a CSV, so we&#8217;ll drop the redirect and list formatting, and replace it with a pipe like this:</p>
<pre>| Export-Csv ExportCsvServerList.csv</pre>
<p>Now a warning about the CSV export&#8230;  Unfortunately, Microsoft chose to include a &#8220;restricted&#8221; symbol (little r in a circle) in the Server 2008 (non-R2) name, like this:</p>
<pre>Windows Server® 2008 Standard</pre>
<p>&#8230;and, the CSV export operates only with the ASCII set by default.  Sheesh.  So, we use the UTF8 flag to make sure the wacky &#8220;restricted&#8221; mark is rendered correctly, like this:</p>
<pre>| Export-Csv -Encoding UTF8 ExportCsvServerList.csv</pre>
<p>So with all that, we end up with a command looking like this:</p>
<pre>Get-AdComputer -LDAPFilter "(OperatingSystem=*Server*)" -Properties IPv4Address,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion | Export-Csv -Encoding UTF8 ExportCsvServerList.csv</pre>
<p>And since it&#8217;s a spreadsheet you can further filter/format/manipulate the results how you see fit.</p>
<p>One more thing that causes confusion sometimes: </p>
<p>Be aware that even though we are calling ActiveDirectory for these servers and their correlating properties, there&#8217;s one of these items that don&#8217;t come from there: the IP Address.  As you are likely aware, the IP address of a computer object is not stored in the directory; so what is actually happening is that the Get-AdComputer module is retrieving the FQDN of the computer, and doing a DNS query to resolve it to the address for you. </p>
<p>Now, this can be good or bad, depending on your situation; for instance, it might slow down your 8000+ server export&#8230; or might also help alleviate the burden on your AD server as you make the query (while it delays the processing a tad to retrieve the name).  Also, you&#8217;d better be able to rely on your DNS to return valid values, or the results might be confusing/misleading! </p>
<p>I hope that helps&#8230;  Thanks for reading, and by all means if you have additional tips, be sure to comment!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/03/21/powershell-query-active-directory-for-server-versions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing HKCU keys using a Windows Installer repair</title>
		<link>http://www.coretekservices.com/2013/03/14/installing-hkcu-keys-using-a-windows-installer-repair/</link>
		<comments>http://www.coretekservices.com/2013/03/14/installing-hkcu-keys-using-a-windows-installer-repair/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 05:29:52 +0000</pubDate>
		<dc:creator>Paul Opper</dc:creator>
				<category><![CDATA[Application Packaging]]></category>
		<category><![CDATA[Desktop Management]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Application Delivery]]></category>
		<category><![CDATA[msi]]></category>
		<category><![CDATA[Windows Installer]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=4145</guid>
		<description><![CDATA[One of the more common (and tricky) issues faced when installing an application in the enterprise is how to install user data.  Typically, the application installer is run silently with no user interaction in the &#8220;system&#8221; context with administrative privileges.  This method is commonly used so that the software can install in the background without disrupting [...]]]></description>
				<content:encoded><![CDATA[<p>One of the more common (and tricky) issues faced when installing an application in the enterprise is how to install user data.  Typically, the application installer is run silently with no user interaction in the &#8220;system&#8221; context with administrative privileges.  This method is commonly used so that the software can install in the background without disrupting the end users work.  Fortunately, this method works for a majority of software deployments, because the installer does not need to install anything in the &#8220;user&#8221; context. </p>
<p>There are situations, however, when an application requires registry keys or some data files installed in the user&#8217;s profile prior to the applications first launch.  One common post-installation method used for installing user data is called &#8220;Active Setup&#8221;; a full explanation of how to implement this method is beyond the scope of this post&#8230; and besides&#8230; there&#8217;s already been <a title="http://www.coretekservices.com/2012/03/29/active-setup-solve-problematic-hkcu-keys/" href="http://www.coretekservices.com/2012/03/29/active-setup-solve-problematic-hkcu-keys/" target="_blank">a blog post on this topic</a>! </p>
<p><span style="font-size: 13px;">A major drawback of the Active Setup method is that any user logged on to the system when the silent installation occurred must log out of their profile and log back in.  The reason is because the mechanism which initiates Active Setup compares a Local Machine registry keys to one in the User&#8217;s profile when the user logs on.  A more convenient and functional method (and slicker, I must say) to install data to the user profile in the user context is by initiating a Windows Installer repair. </span></p>
<p>By design, Windows Installer initiates &#8220;self repair&#8221; or &#8220;self healing&#8221; when an entry point to the installed application is launched.  Typically, the entry point is an &#8220;Advertised&#8221; shortcut.  When the user clicks on the shortcut, Windows Installer will perform an integrity check to verify all the &#8220;key paths&#8221; of the installed application are present; if not present, the Windows Installer repair will install any missing component(s) and their key path.  The key path of a component is typically a file or shortcut. </p>
<p>One  method for installing Current User registry keys post install is to add a top level &#8220;Hidden Feature&#8221; (note: the feature doesn&#8217;t really <em>have</em> to be hidden, but we do this to ensure that whoever runs the install doesn&#8217;t have the option not to install it) to the install which contains all the HKCU keys.  Mark the feature as &#8220;required&#8221; and make it the &#8220;Parent&#8221; feature to all other features in your MSI.  Move all HKCU keys to the same component in the required feature.  Finally, add an &#8220;advertised&#8221; to your application to facilitate the repair.  After the application is installed (in the system context), when a user click on the advertised shortcut a self repair will occur to install the components with the missing key paths&#8230; <em>IF</em> the key path doesn&#8217;t exist.</p>
<p>Ya see&#8230;this blog post was partly inspired by a setup I encountered on a customer location which attempted to use this method for installing the required HKCU registry keys.  When I tested the application, it was not behaving as expected.  I looked into the .MSI that installed it and found that everything had been laid out according to the prescribed method detailed above&#8230; except&#8230; the component key path holding the HKCU keys was actually an HKLM registry key which <strong><em>already existed on my system</em></strong>!  Thus, the self repair would never &#8220;kick off&#8221;.  When attempting to initiate a controlled Windows Installer repair, you must ensure the component key path is truly unique, or the repair won&#8217;t happen. </p>
<p>I hope you enjoyed this little insight into Windows Installer and find this method to install user data helpful.  This was just a high level overview; next week, I&#8217;ll follow up with a more detailed post on how to implement this functionality. </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/03/14/installing-hkcu-keys-using-a-windows-installer-repair/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell &#8211; Detect Group Membership Type&#8230;</title>
		<link>http://www.coretekservices.com/2013/03/07/powershell-detect-group-membership-type/</link>
		<comments>http://www.coretekservices.com/2013/03/07/powershell-detect-group-membership-type/#comments</comments>
		<pubDate>Thu, 07 Mar 2013 06:06:52 +0000</pubDate>
		<dc:creator>Jeremy Pavlov</dc:creator>
				<category><![CDATA[Microsoft Infrastructure]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[get-adgroupmember]]></category>
		<category><![CDATA[group objects]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[membership]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.coretekservices.com/?p=3918</guid>
		<description><![CDATA[It should come as no surprise that adherence to naming conventions and good Active Directory (AD) Organizational Unit (OU) structure are things that can make an Enterprise Administrator&#8217;s life much easier.  Take, for example, the situation of having a naming convention for group objects in AD that dictates a single-letter suffix of either a &#8220;C&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p>It should come as no surprise that adherence to naming conventions and good Active Directory (AD) Organizational Unit (OU) structure are things that can make an Enterprise Administrator&#8217;s life much easier. </p>
<p>Take, for example, the situation of having a naming convention for group objects in AD that dictates a single-letter suffix of either a &#8220;C&#8221; (to indicate a group of computer objects) or a &#8220;U&#8221; (for a group of user objects).  In this case, a group might be named something like, &#8220;Detroit Application Data U&#8221;, or &#8220;Chicago Printers Floor2 C&#8221;.  And with intentions such as these &#8212; and human beings being what they are &#8212; it&#8217;s inevitable that some users will end up in computer groups, and vice versa.</p>
<p>So how to we check for this messiness?  With PowerShell, of course&#8230;</p>
<p>We create a script that will accept an array of our AD OUs (or group-specific OUs if you&#8217;re lucky), loop through them, grab all the groups and the memberships, and do a validation to make sure the members are of the correct class (note that I could fill up pages of the lines of code for this, depending on your specifics; so I&#8217;ll just stick with the main conceptual points).  Let&#8217;s dive into the code snippets!</p>
<p>First, add your OUs into an array, and other variables.  Of course, you might not be able to just scrape a level with PowerShell and grab all your OUs&#8230;  Oh, but you *do* have a perfectly-regulated AD hierarchy, don&#8217;t you?  Whether it&#8217;s perfect or not, AD structure goes a long way here; and my examples show how convenient it is if you have all your groups in a standard ou=GROUPS structure or some predictable way.</p>
<p><code>$OUs = @("Detroit", "Chicago", "Los Angeles")</code> <br /><code>$MyDomain = "dc=MyDomain,dc=org"</code></p>
<p>Then you start to loop and grab all the groups in an OU:</p>
<pre>foreach ($OU in $OUs)<br />{<br />  #... skipped a few more lines of code here...<br />  # Here we get the list of our groups for the loop<br />  $OuGroupNames = Get-ADObject -Filter {(ObjectClass -eq "group") -and ((name -like "* U") -or (name -like "* C"))} -SearchBase "ou=Groups,ou=$OU,$MyDomain"</pre>
<p>And, now that you have the groups, you can start to evaluate each group like this:</p>
<pre>  foreach ($OuGroup in $OuGroupNames)
  {
    #...skip more code.. What are we skipping here? Oh, validations, error-checking, and stuff...<br />    # we need the group name and DN
    $OuGroupName = $OuGroup.Name
    $OuGroupDn = $OuGroup.DistinguishedName</pre>
<p>Now, we can truly check the object membership type!</p>
<pre>    # If it is a user group...<br />    if ($OuGroupName -like "* U")
    {
      $MemberList = Get-ADGroupMember -Identity "$OuGroupName"<br />      # ...it had better be a user...
      if ($Member.ObjectClass -like "computer")<br />      {<br />        #...or we kick out an error to the report!</pre>
<p>And so on.  Of course, you&#8217;d do the converse of the snippet above for a user-type object in a &#8220;C&#8221; group.  By the way, this can lead to all kinds of other error detection too; in fact, the main reason I couldn&#8217;t show all my code is that I ended up adding checks for empty groups, groups with members from external OUs, and so on.  Because basically, once you have the group attributes and its membership list in hand, you may as well do some validation while you&#8217;re there&#8230;</p>
<p>So have fun with it, and see where it leads you&#8230;  And make sure to drop me a line if you need any help putting the whole thing together.</p>
<p> <img src='http://www.coretekservices.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coretekservices.com/2013/03/07/powershell-detect-group-membership-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
