<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-4830641179638078616</atom:id><lastBuildDate>Sun, 13 May 2012 18:32:41 +0000</lastBuildDate><category>Misc</category><category>PowerShell</category><category>Security</category><category>Insteon</category><category>System Config</category><category>HyperV</category><category>Programming</category><category>Networking</category><title>Mike Poulson's Thoughts on lots of stuff</title><description></description><link>http://www.mikepoulson.com/</link><managingEditor>noreply@blogger.com (Mike Poulson)</managingEditor><generator>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-8598051767756129004</guid><pubDate>Mon, 06 Feb 2012 04:04:00 +0000</pubDate><atom:updated>2012-03-04T20:41:52.223-08:00</atom:updated><title>Home Circuit Power Monitoring - Part 2</title><description>It has been about 6 months from when I installed per circuit power monitoring in my home (&lt;a href="http://www.mikepoulson.com/2011/07/new-home-power-monitor.html"&gt;http://www.mikepoulson.com/2011/07/new-home-power-monitor.html&lt;/a&gt;). &lt;br /&gt;&lt;br /&gt;In January 2012 I started injecting all my power data into a SQL DB (SQL Express).&amp;nbsp; This has allowed me to use Tableau (&lt;a href="http://www.tableausoftware.com/"&gt;www.tableausoftware.com&lt;/a&gt;) to analyze the utilization. &lt;br /&gt;&lt;br /&gt;Here is an example of that power consumption in my House.&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;script src="http://public.tableausoftware.com/javascripts/api/viz_v1.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;div class="tableauPlaceholder" style="height: 800px; width: 1000px;"&gt;&lt;noscript&gt;&amp;lt;a href="#"&amp;gt;&amp;lt;img alt="Cost " src="http://public.tableausoftware.com/static/images/Ho/HomePower2/Cost/1_rss.png" style="border: none" /&amp;gt;&amp;lt;/a&amp;gt;&lt;/noscript&gt;&lt;object class="tableauViz" height="800" style="display: none;" width="1000"&gt;&lt;param name="host_url" value="http%3A%2F%2Fpublic.tableausoftware.com%2F" /&gt; &lt;param name="site_root" value="" /&gt; &lt;param name="name" value="HomePower2&amp;#47;Cost" /&gt; &lt;param name="tabs" value="no" /&gt; &lt;param name="toolbar" value="yes" /&gt; &lt;param name="static_image" value="http:&amp;#47;&amp;#47;public.tableausoftware.com&amp;#47;static&amp;#47;images&amp;#47;Ho&amp;#47;HomePower2&amp;#47;Cost&amp;#47;1.png" /&gt; &lt;param name="animate_transition" value="yes" /&gt; &lt;param name="display_static_image" value="yes" /&gt; &lt;param name="display_spinner" value="yes" /&gt; &lt;param name="display_overlay" value="yes" /&gt; &lt;param name="display_count" value="yes" /&gt; &lt;/object&gt;&lt;/div&gt;&lt;div style="color: black; font-size-adjust: none; font-stretch: normal; font: 8pt/normal verdana, helvetica, arial, sans-serif; height: 22px; padding: 0px 10px 0px 0px; width: 1711px;"&gt;&lt;div style="float: right; padding-right: 8px;"&gt;&lt;a href="http://www.tableausoftware.com/public?ref=http://public.tableausoftware.com/views/HomePower2/Cost" target="_blank"&gt;Powered by Tableau&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;You can see my office plugs (where my Media Center is located) is my #1 consumer of power.&amp;nbsp; You can see that the TV and Kitchen outlets are in second place.&lt;br /&gt;&lt;br /&gt;I used the data shown here to determine that my 1st floor lights use a lot of power.&amp;nbsp;&amp;nbsp; This weekend I replaced those 400 Watts of lights with new LEDs (Phillips Ambient LED, &lt;a href="http://www.amazon.com/Philips-409904-Dimmable-AmbientLED-12-5-Watt/dp/B004IUMGV4"&gt;http://www.amazon.com/Philips-409904-Dimmable-AmbientLED-12-5-Watt/dp/B004IUMGV4&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;You can see from the graph below how much power I used to watch the "BIG GAME".&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-azk1iFVKhAs/Ty9OyRlV56I/AAAAAAAAA-U/Qyj5jGtONSI/s1600/Big+Game+2012.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="328" src="http://4.bp.blogspot.com/-azk1iFVKhAs/Ty9OyRlV56I/AAAAAAAAA-U/Qyj5jGtONSI/s640/Big+Game+2012.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Based off this and a power cost of $.09/Kwh it cost ~$.24﻿ to watch the game.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;(539 watts /1000 = .539Kw * 5 hours = 2.70KwH * .09 = $.245)&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;This does not include the cost of beer, snacks, the cookies, steaks or stress.&amp;nbsp; &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;To get this to work I use tenEcmServer and tenEcmDB from &lt;a href="http://tenholder.net/tenWare2/tenEcmServer/default.aspx"&gt;http://tenholder.net/tenWare2/tenEcmServer/default.aspx&lt;/a&gt;.&amp;nbsp; The tenEcmDB needed a little modification to work with SQL Server.&amp;nbsp; By default it works with SQLLight.&amp;nbsp; With the tenEcm components I can monitor my BrulTech equipment and provided extensive reporting on it.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-8598051767756129004?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2012/02/home-circuit-power-monitoring-part-2.html</link><author>noreply@blogger.com (Mike Poulson)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-azk1iFVKhAs/Ty9OyRlV56I/AAAAAAAAA-U/Qyj5jGtONSI/s72-c/Big+Game+2012.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-8766281821826328885</guid><pubDate>Thu, 06 Oct 2011 02:36:00 +0000</pubDate><atom:updated>2011-10-05T19:36:51.892-07:00</atom:updated><title>Not a big fan of new Microsoft Touch mouse</title><description>I upgraded from the Microsoft Touch Arch mouse to the new TouchMouse.&amp;nbsp; I must say I am not a fan.&lt;br /&gt;&lt;br /&gt;The new mouse looks nice and all but does not work as well as I would like.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.productwiki.com/upload/images/microsoft_touch_mouse.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://www.productwiki.com/upload/images/microsoft_touch_mouse.JPG" width="295" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The new TouchMouse has a single button.&amp;nbsp; It utilizes touch sensors to detect if you are using the left or right finger to press down.&amp;nbsp; The problem that I have it is I rest my fingers on my mouse.&amp;nbsp; This causes the mouse to think I am using the multi-touch (two finger) to minimize or maximize windows. It also sometimes thinks I am pressing the right button when I press the left.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-8766281821826328885?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/10/not-big-fan-of-new-microsoft-touch.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-1679873046041114666</guid><pubDate>Tue, 16 Aug 2011 23:17:00 +0000</pubDate><atom:updated>2011-08-16T16:17:46.653-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Insteon</category><title>Home Automation with Insteon - New Ceiling fan</title><description>I got my first Insteon switches and setup in 2005.  At the time it was an early product and still had issues and did not have the number of options that exist today.&lt;br /&gt;&lt;br /&gt;I live in a 4 story townhome that faces southwest.  Because of this the top floor can get super warm in the summer time.  To help resolve this we desided to install a ceiling fan where there was just a light before.&lt;br /&gt;&lt;br /&gt;There are 2x 3 way switches that control the light at the top of my stairs. There are also lights on the wall controlled by the same switches.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is how it looked before I started.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://dl.dropbox.com/u/3275573/blog/insteon/old_4th_floor_light.png" width=600 height=600/&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Insteon&lt;/h2&gt;I replaced the 2 standard decora switches with &lt;a href="http://www.smarthome.com/2487S/KeypadLinc-INSTEON-6-Button-Scene-Control-Keypad-with-On-Off-Switch-Dual-Band-White/p.aspx"&gt;Insteon KeypadLinc Switches &lt;/a&gt;.&amp;nbsp; Then added 2 wire-in controllers.&amp;nbsp; 1 &lt;a href="http://www.smarthome.com/2475D/In-LineLinc-Dimmer-INSTEON-Remote-Control-In-Line-Dimmer/p.aspx"&gt;dimming controller&lt;/a&gt; and 1 &lt;a href="http://www.smarthome.com/2475S2/INSTEON-In-LineLinc-On-Off-Module-Non-dimming-w-Sense/p.aspx"&gt; non-Dimming controller&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once all that was done I installed the new fan and wired the fan load to the non-dimming controller and the lights to the dimming controller.&lt;br /&gt;&lt;br /&gt;Here is what it looks like now.&lt;br /&gt;&lt;img src="http://dl.dropbox.com/u/3275573/blog/insteon/new_4th_floor_light.png" width=600 height=600&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-1679873046041114666?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/08/home-automation-with-insteon-new.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-6221856624723059067</guid><pubDate>Fri, 05 Aug 2011 21:26:00 +0000</pubDate><atom:updated>2011-08-05T14:26:19.254-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>System Config</category><title>WDS and Symbolic Links</title><description>Windows Deployment Services (WDS) is all my team and I use for OS deployments. We regularly use the $OEM$\$1 option to copy files and scripts to the target install. &lt;a href="http://technet.microsoft.com/en-us/library/cc766320(WS.10).aspx"&gt;More on $OEM$&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Recently we  started updating scripts that are in a $OEM$, $$ or $1 folder.  This was very time consuming because you had to update a large number (~50) different images.&lt;br /&gt;&lt;br /&gt;The solution to this problem: Hard Links &lt;a href="http://msdn.microsoft.com/en-us/library/aa365006(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa365006(v=vs.85).aspx&lt;/a&gt; &lt;br /&gt;We use the Mklink command to create a Hard link to a “source file”.  WDS follows this link and copies the script\file to the target OS during install.  This allows us to have a &lt;b&gt;GOLD&lt;/b&gt; set of scripts that will get copied yet we only have to make a change in 1 location.&lt;br /&gt;&lt;br /&gt;The important thing when making the link with mklink is to pass the /k argument.  This will tell mklink to make a hard link not a Symbolic link.   You can find more on Mklink at &lt;a href="http://technet.microsoft.com/en-us/library/cc753194(WS.10).aspx"&gt;http://technet.microsoft.com/en-us/library/cc753194(WS.10).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;WDS will not work with a Symbolic link and will throw an error like:&lt;br /&gt;&lt;i&gt;Windows cannot copy files from &lt;SHARE&gt;\$OEM$ to C:\$WINDOWS.~LS\Sources. The files do not exist. Make sure all files required for installation are available, and restart the installation. Error code: 0x80070003]&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This works on Windows Server 2008, Windows Server 2008 R2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-6221856624723059067?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/08/wds-and-symbolic-links.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-7497763075897923340</guid><pubDate>Wed, 27 Jul 2011 19:17:00 +0000</pubDate><atom:updated>2011-07-27T12:18:15.909-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>HyperV</category><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>Windows Server 2008 Hyper-V Geographically Dispersed Cluster with IBM XIV Storage iSCSI</title><description>Here is a paper that I worked on at my team at Microsoft.  The Enterprise Engineering Center (&lt;a href="http://www.microsoft.com/eec"&gt;http://www.microsoft.com/eec&lt;/a&gt;) has a IBM XIV array that we used with the other array on campus. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/1fade10926963a4a86257818000d63e1/$FILE/Windows%20Server%202008%20Hyper-V%20Geographically%20Dispersed%20Cluster%20with%20IBM%20XIV%20Storage.pdf"&gt;Windows Server 2008 Hyper-V Geographically Dispersed Cluster with IBM XIV Storage iSCSI&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can find more info on the Tunnel used in this whitepaper at &lt;a href="http://www.mikepoulson.com/2011/06/l2tpv3-performance-tweaks-for-hyperv.html"&gt;http://www.mikepoulson.com/2011/06/l2tpv3-performance-tweaks-for-hyperv.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-7497763075897923340?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/07/windows-server-2008-hyper-v.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-5866882958869006849</guid><pubDate>Wed, 27 Jul 2011 16:43:00 +0000</pubDate><atom:updated>2011-07-27T09:51:11.528-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><category domain='http://www.blogger.com/atom/ns#'>PowerShell</category><title>How to create differencing disk VM from template on SCVMM 2012 via powershell</title><description>This quick post will provide an example of how to create a Virtual Machine (VM) based off an VMM template that utilizes differencing disks.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;This is special because&amp;nbsp;VMM does not support this natively.&amp;nbsp; So you have to contact the target HyperV host (via WMI) to create the Diff disk.&amp;nbsp; In addition to need to make sure that the HyperV host has the parent VHD already in place.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;The Powershell cmdlet below does the following&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Looks up the specified Hardware profile&lt;/li&gt;&lt;li&gt;Looks up the specified template (this is used to get the parent VHD location/name)&lt;/li&gt;&lt;li&gt;Looks up info on the specified target HyperV host (so we can find the placement drive)&lt;/li&gt;&lt;li&gt;Checks to see if the ParentVHD already exists on the HyperV hosts Placement Drive&lt;/li&gt;&lt;li&gt;If the VHD does not exist it copies it to the HyperV host&lt;/li&gt;&lt;li&gt;Creates Diff Disk via WMI on hyperV host pointing to parent VHD&lt;/li&gt;&lt;li&gt;Creates the VM via the New-SCVirtualMachine cmdlet using the UseLocalVirtualHardDisk command. (this tells VMM to allow Diff disks).&lt;/li&gt;&lt;/ol&gt;It can be downloaded from &lt;a href="http://dl.dropbox.com/u/3275573/Create_Diff_VM_From_Template.ps1"&gt;http://dl.dropbox.com/u/3275573/Create_Diff_VM_From_Template.ps1&lt;/a&gt;&lt;br /&gt;&lt;ol&gt;&lt;/ol&gt;&lt;pre&gt;param($VMName,$TemplateName = "Windows Server 2008 R2 SP1 Enterprise", $HardwareProfileName = "ServerHardware", $VMMHost = "SCVMM",$targethostname = $null)&lt;br /&gt;&lt;br /&gt;$Err = 0&lt;br /&gt;&lt;br /&gt;If ($VMName -eq $null)&lt;br /&gt;{&lt;br /&gt;  Write-Host "`nERROR: Incorrect arguments" -foregroundcolor red -backgroundcolor black&lt;br /&gt;   Write-Host "`nREQUIRED ARGUMENTS:" -foregroundcolor cyan&lt;br /&gt;   Write-Host "`n   -VMName `"Name of the VM to create`"" -foregroundcolor cyan&lt;br /&gt;   Write-Host "`n   -TemplateName `"Name of the VMM Template`"" -foregroundcolor cyan&lt;br /&gt;   Write-Host "`n   -HardwareProfileName `"Name of the VMM Hardware Profile to use with the template`"" -foregroundcolor cyan&lt;br /&gt;   Write-Host "`n   -VMMHost `"VMM Computername`"" -foregroundcolor cyan&lt;br /&gt;   Write-Host "`n   -targetHostname `"Computername of HyperV host to target`"" -foregroundcolor cyan&lt;br /&gt;  Exit $Err&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function CreateDiffDiskOnHost&lt;br /&gt;{&lt;br /&gt;                param([string]$hostComputerName, [string]$childPath, [string]$parentPath)&lt;br /&gt;                #get the image mgmt service instance for the host computer&lt;br /&gt;                $VHDService = get-wmiobject -class "Msvm_ImageManagementService" -namespace "root\virtualization" -computername $hostComputerName&lt;br /&gt;                &lt;br /&gt;                #create a differencing disk from the base disk&lt;br /&gt;                $Result = $VHDService.CreateDifferencingVirtualHardDisk($childPath, $parentPath)&lt;br /&gt;}&lt;br /&gt;function TestFileLock {&lt;br /&gt;    ## Attempts to open a file and trap the resulting error if the file is already open/locked&lt;br /&gt;    param ([string]$filePath )&lt;br /&gt;    $filelocked = $false&lt;br /&gt;    $fileInfo = New-Object System.IO.FileInfo $filePath&lt;br /&gt;    trap {&lt;br /&gt;        Set-Variable -name locked -value $true -scope 1&lt;br /&gt;        continue&lt;br /&gt;    }&lt;br /&gt;    $fileStream = $fileInfo.Open( [System.IO.FileMode]::OpenOrCreate, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None )&lt;br /&gt;    if ($fileStream) {&lt;br /&gt;        $fileStream.Close()&lt;br /&gt;    }&lt;br /&gt;    $obj = New-Object Object&lt;br /&gt;    $obj | Add-Member Noteproperty FilePath -value $filePath&lt;br /&gt;    $obj | Add-Member Noteproperty IsLocked -value $filelocked&lt;br /&gt;    $obj&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;write-host "VMName is $VMName"&lt;br /&gt;write-host "Template is $TemplateName"&lt;br /&gt;write-host "Hardware Profile is $HardwareProfileName"&lt;br /&gt;write-host "VMMHost is $VMMHost"&lt;br /&gt;write-host "Target Host is $targethostname"&lt;br /&gt;&lt;br /&gt;$guid = [guid]::NewGuid()&lt;br /&gt;&lt;br /&gt;write-host "Lookup the base hardware Profile $HardwareProfileName"&lt;br /&gt;$HardwareProfile = Get-SCHardwareProfile -VMMServer $VMMHost  | where {$_.Name -eq $HardwareProfileName}&lt;br /&gt;if ($HardwareProfile -eq $null)&lt;br /&gt;    {&lt;br /&gt;        write-host "Failed to lookup HardwareProfile $HardwareProfileName"  -foregroundcolor red -backgroundcolor black&lt;br /&gt;     EXIT 1&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;write-host "Getting information for template $TemplateName"&lt;br /&gt;$Template = Get-SCVMTemplate -VMMServer $VMMHost  -All | where {$_.Name -eq $TemplateName}&lt;br /&gt; if ($Template -eq $null)&lt;br /&gt;    {&lt;br /&gt;        write-host "Failed to lookup Template $TemplateName"  -foregroundcolor red -backgroundcolor black&lt;br /&gt;     EXIT 1&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;#Get the VHD info for the template&lt;br /&gt;$VHD =  Get-SCVirtualharddisk | where {$_.Name -eq $template.VirtualDiskDrives[0].VirtualHardDisk}&lt;br /&gt;&lt;br /&gt;write-host "Template VHD Path " $VHD.SharePath&lt;br /&gt;&lt;br /&gt;if ($targethostname -eq $null)&lt;br /&gt;{&lt;br /&gt;    write-host "Invalid targethostname"  -foregroundcolor red -backgroundcolor black&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;$vmhost = Get-SCVMHost $targethostname&lt;br /&gt;&lt;br /&gt;$vmHostPath = [string]$vmhost.vmpaths&lt;br /&gt;write-host "Target VMHost: "  $vmhost.name&lt;br /&gt;write-host "Target Drive: "  $vmhost.VMPaths&lt;br /&gt;&lt;br /&gt;$remotePath = "\\" + $vmhost.name + "\" + $vmHostPath.substring(0,1) + "$\" + [system.io.path]::GetFileName($VHD.SharePath)&lt;br /&gt;"Checking to see if Parent VHD exists on HV Host Drive"&lt;br /&gt;"RemotePath: $remotePath"&lt;br /&gt;&lt;br /&gt;if (Test-Path $remotePath)&lt;br /&gt;{&lt;br /&gt; "Parent VHD already exists on HV Host"&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt; "$RemotePath does not exist, going to Copy"&lt;br /&gt; [System.IO.File]::Copy($VHD.SharePath,$remotePath); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;"Creating Diff Disk"&lt;br /&gt;$targetVHDPath = $vmHostPath + $VMName + ".vhd"&lt;br /&gt;$ParentVHDPath = $vmHostPath + [system.io.path]::GetFileName($VHD.SharePath)&lt;br /&gt;CreateDiffDiskOnHost "$vmhost" "$targetVHDPath" "$ParentVHDPath"&lt;br /&gt;Start-Sleep -s 20&lt;br /&gt;&lt;br /&gt;$targetVHDRemotePath = "\\" + $vmhost.name + "\" + $vmHostPath.substring(0,1) + "$\" + $VMName + ".vhd"&lt;br /&gt;if (Test-Path $targetVHDRemotePath)&lt;br /&gt;{&lt;br /&gt; "Diff Disk Created at:$targetVHDRemotePath"&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt; "$targetVHDRemotePath does not exist yet.  Sleeping for a few"&lt;br /&gt; Start-Sleep -s 30&lt;br /&gt;    if (Test-Path $targetVHDRemotePath)&lt;br /&gt;    {&lt;br /&gt;        "Disk was created."&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        write-host "Failed to find VHD $targetVHDRemotePath after sleep, exiting" -foregroundcolor red -backgroundcolor black&lt;br /&gt;        exit 1&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;#Set a random startup delay to reduce VM startup IOPs overload&lt;br /&gt;$startDelay = Get-Random -minimum 1 -maximum 30&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$lockstate = TestFileLock "$targetVHDRemotePath"&lt;br /&gt;if ($lockstate.IsLocked)&lt;br /&gt;{&lt;br /&gt;    "File locked, sleeping"&lt;br /&gt;    Start-Sleep -s 30&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$mv = move-SCvirtualharddisk -Bus 0 -Lun 0 -IDE -path $targetVHDPath  -jobgroup $guid&lt;br /&gt;$description = $template.tag&lt;br /&gt;New-SCVirtualMachine -Name $vmName -VMHost $vmHost -VMTemplate $template -UseLocalVirtualHardDisk -HardwareProfile $HardwareProfile -ComputerName $vmName -path $vmHostPath -delaystartseconds $startDelay  -Description "$description" -mergeanswerfile $true -BlockDynamicOptimization $false -StartVM -JobGroup "$guid" -RunAsynchronously -StartAction "AlwaysAutoTurnOnVM" -StopAction "SaveVM"&lt;br /&gt;&lt;/pre&gt;&lt;script type="text/javascript"&gt;     SyntaxHighlighter.all() &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-5866882958869006849?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/07/how-to-create-differencing-disk-vm-from.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-6821986822772904106</guid><pubDate>Mon, 18 Jul 2011 17:14:00 +0000</pubDate><atom:updated>2011-07-25T20:42:37.859-07:00</atom:updated><title>Home Circuit Power Monitoring</title><description>Ever wonder why your home power bill is so high?&amp;nbsp;&amp;nbsp; Or just want to know how much power you use in various parts of your house through the whole day?&amp;nbsp; &lt;br /&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I have one of the Blue Line Power monitors for Microsoft Hohm (&lt;a href="http://www.bluelineinnovations.com/Products/PowerCost-Monitor/"&gt;http://www.bluelineinnovations.com/Products/PowerCost-Monitor/&lt;/a&gt;).&amp;nbsp; This product did not allow me to see how much a single room or circuit was using.&amp;nbsp; It was a start.&amp;nbsp; &lt;/div&gt;&lt;br /&gt;I have the LCD display in my living room near the TV so that I can quickly see how much energy my home is consuming.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3dHGENn_24Y/TiNgR53SHcI/AAAAAAAAAro/93osx2l0Vy4/s144/Hohm.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="233" src="http://4.bp.blogspot.com/-3dHGENn_24Y/TiNgR53SHcI/AAAAAAAAAro/93osx2l0Vy4/s400/Hohm.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Microsoft Hohm Data (Sunday, Got up at ~9am)&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;For my 30th birthday I got all the parts I need to do per-circuit power monitoring for my whole house. By doing branch circuit monitoring I can answer many questions about my enery usage.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-vTgjxsEZMpE/Tfz7EWNGsII/AAAAAAAAAog/NeAzCDv4mkI/s144/IMG_6316.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;What does this mean?&amp;nbsp; I can tell you things like:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;How often does my water heater (&lt;a href="http://www.geappliances.com/heat-pump-hot-water-heater/high-efficiency-water-heater-savings.htm"&gt;http://www.geappliances.com/heat-pump-hot-water-heater/high-efficiency-water-heater-savings.htm&lt;/a&gt;) turn on.&amp;nbsp; &lt;/li&gt;&lt;li&gt;How long does it run&lt;/li&gt;&lt;li&gt;How much power does it use&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Exactly how much does it cost me for it to run&lt;/li&gt;&lt;ul&gt;&lt;li&gt;How much power does my house use when I turn off all my normal items&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Leaving things like laptop and cell phone chargers on&lt;/li&gt;&lt;ul&gt;&lt;li&gt;How much does it cost me to run my AC in the summer?&amp;nbsp; Is it worth leaving on all day or turning on just when I get home&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Or in my case thanks to Insteon I can turn it on before I leave work!&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The Solution:&lt;/div&gt;&lt;div&gt;I got the ECM1240 system from Brultech.com.&amp;nbsp; Specifically the PP3-200-X (&lt;a href="http://www.brultech.com/home/store/product.php?id_product=34"&gt;http://www.brultech.com/home/store/product.php?id_product=34&lt;/a&gt;)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I installed solid core CTs on each breaker on my home circuit panel.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/-vTgjxsEZMpE/Tfz7EWNGsII/AAAAAAAAAog/NeAzCDv4mkI/s144/IMG_6316.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-vTgjxsEZMpE/Tfz7EWNGsII/AAAAAAAAAog/NeAzCDv4mkI/s400/IMG_6316.JPG" width="266" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-0kZdPSZ3c7U/Tfz7GCZuboI/AAAAAAAAAow/wyswIdFxeq4/s144/IMG_6425.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To hold the ECM1240 brains I installed a PVC box just next to my main panel to hold all the low voltage items.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/-0kZdPSZ3c7U/Tfz7GCZuboI/AAAAAAAAAow/wyswIdFxeq4/s144/IMG_6425.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://2.bp.blogspot.com/-0kZdPSZ3c7U/Tfz7GCZuboI/AAAAAAAAAow/wyswIdFxeq4/s400/IMG_6425.JPG" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The ECM1240 allows me to view my data in real-time via the my1240.com website, read the data from google powermeter or push it into my own data collection environment.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The &lt;strong&gt;CONS&lt;/strong&gt; about the 1240 system are:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;The software to manage the 1240 collection devices has more bugs in it than Windows ME. It crashes often and overall is a piece of junk.&lt;/li&gt;&lt;li&gt;The solution by default only supports Google powermeter not &lt;a href="http://www.microsoft-hohm.com/"&gt;www.Microsoft-hohm.com&lt;/a&gt;.&amp;nbsp; &lt;/li&gt;&lt;ul&gt;&lt;li&gt;While google powermeter has its ups one thing that is has a serious issue with it is the User interface sucks&lt;/li&gt;&lt;li&gt;The ability to export the data into CSV format from google is nice. Not an option on &lt;a href="http://www.microsoft-hohm.com/"&gt;www.Microsoft-hohm.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The ability to share access to my power data from google is nice. Not an option on &lt;a href="http://www.microsoft-hohm.com/"&gt;www.Microsoft-hohm.com&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;With Google Powermeter and Microsoft-hohm.com being retired I will have to find a new way to view my power data.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;strong&gt;Google Power Meter Data&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;div&gt;&lt;/div&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/-uMQm_TDyVXU/TiNnfWCOQ4I/AAAAAAAAArw/E_8hL4oTf8U/s144/chart2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://4.bp.blogspot.com/-uMQm_TDyVXU/TiNnfWCOQ4I/AAAAAAAAArw/E_8hL4oTf8U/s400/chart2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My1240.com Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Controller 1&lt;/strong&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-zQ-xw_H6Jl4/TiRlP38ItOI/AAAAAAAAAsg/NYMjmcg9-Ms/s144/my1240-Powerdata.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="246" src="http://4.bp.blogspot.com/-zQ-xw_H6Jl4/TiRlP38ItOI/AAAAAAAAAsg/NYMjmcg9-Ms/s320/my1240-Powerdata.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Controller 2&lt;/strong&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/-Mww2-4P6nWU/TiRlnL5MLHI/AAAAAAAAAsk/5tUjeoY-sCM/s144/my1240-Powerdata-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="237" src="http://1.bp.blogspot.com/-Mww2-4P6nWU/TiRlnL5MLHI/AAAAAAAAAsk/5tUjeoY-sCM/s320/my1240-Powerdata-2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Controller 3&lt;/strong&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-GyBivRsHzhk/TiRlnb_d-BI/AAAAAAAAAso/yx9danODOrE/s144/my1240-Powerdata-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="260" src="http://4.bp.blogspot.com/-GyBivRsHzhk/TiRlnb_d-BI/AAAAAAAAAso/yx9danODOrE/s320/my1240-Powerdata-3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/-GyBivRsHzhk/TiRlnb_d-BI/AAAAAAAAAso/yx9danODOrE/s144/my1240-Powerdata-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-GyBivRsHzhk/TiRlnb_d-BI/AAAAAAAAAso/yx9danODOrE/s144/my1240-Powerdata-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-GyBivRsHzhk/TiRlnb_d-BI/AAAAAAAAAso/yx9danODOrE/s144/my1240-Powerdata-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-6821986822772904106?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/07/new-home-power-monitor.html</link><author>noreply@blogger.com (Mike Poulson)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-3dHGENn_24Y/TiNgR53SHcI/AAAAAAAAAro/93osx2l0Vy4/s72-c/Hohm.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-225755188055946045</guid><pubDate>Sun, 17 Jul 2011 21:55:00 +0000</pubDate><atom:updated>2011-07-17T15:01:27.911-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Misc</category><title>The Delta Touch2O faucet</title><description>How I love my Delta Touch2O faucet.  &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=niy8WlqHw3M"&gt;http://www.youtube.com/watch?v=niy8WlqHw3M&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We had to have an additional hole drilled so that we could install it.  Most of the videos/blogs talk about how it is a big pain to install. But I found it quite simple.  We don't have a lot of room under the sink but i was able to get it done by myself in less than 1 hour.  &lt;br /&gt;&lt;br /&gt;Also we read that there are issues with the batteries draining quickly and needing replacements often.  We have had the same batteries installed for over 1 year now.  It is used everyday by 3 sometimes 4 people.  &lt;br /&gt;&lt;br /&gt;I cannot wait to get one for the bathrooms!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-225755188055946045?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/07/delta-touch2o-faucet.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-318212821317444335</guid><pubDate>Sun, 17 Jul 2011 21:46:00 +0000</pubDate><atom:updated>2011-07-17T14:46:10.571-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><title>Managing Microsoft IIS, Active Directory and DNS from .net</title><description>&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;Update 7/17/2011:&amp;nbsp; New links&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial; font-size: x-small;"&gt;This code was one of my first coding project from &lt;span style="font-family: Times New Roman; font-size: small;"&gt;11-10-2006&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;Today I&amp;nbsp;am posting sample code on how to manage IIS 6 and Active directory using ADSI in VB.NET.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;And managing DNS (creating zones, records and enumeration) using WMI in VB.NET.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;There are four separate projects.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;This code is posted as-is!&amp;nbsp; It is to be used as a sample on how to do the work.&amp;nbsp; It is not intended to be used in production!&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/3275573/blog/ActiveDirectory.zip"&gt;http://dl.dropbox.com/u/3275573/blog&lt;/a&gt;&lt;a href="http://www.mikepoulson.com/code/web.zip"&gt;/web.zip&lt;/a&gt;&amp;nbsp;- ADSI management of IIS 6 Sites and AppPools&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/3275573/blog/ActiveDirectory.zip"&gt;http://dl.dropbox.com/u/3275573/blog/&lt;/a&gt;&lt;a href="http://www.mikepoulson.com/code/DNS.zip"&gt;DNS.zip&lt;/a&gt;&amp;nbsp;- WMI management of Microsoft DNS Zones and Records&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/3275573/blog/ActiveDirectory.zip"&gt;http://dl.dropbox.com/u/3275573/blog/ActiveDirectory.zip&lt;/a&gt;- ADSI management of Active Directory contacts, Groups, Users, Recipient Policies, Accepted Domains objects (Exchange 2007)&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/3275573/blog/IISSiteID.zip"&gt;http://dl.dropbox.com/u/3275573/blog/IISSiteID.zip&lt;/a&gt; - C# code on generating IIS SiteID&lt;br /&gt;&lt;div mce_keep="true"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-318212821317444335?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/07/managing-microsoft-iis-active-directory.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-4190525320853845073</guid><pubDate>Sat, 18 Jun 2011 19:14:00 +0000</pubDate><atom:updated>2011-06-18T12:14:51.953-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>Managing lots of Cisco consoles from one location</title><description>Repost from old blog&lt;br /&gt;&lt;br /&gt;Any who.  The issue:  Lets say you have 16 or so Cisco devices (extreme works also) that connect to various parts of your network.  Now you want to be able to manage these devices remotely but not make a huge security hole using Vlans and attempting to keep it all secure with ACLs.  &lt;br /&gt;&lt;br /&gt;So the easy way is to do all the management via the console port.  No ACLs to worry about and easier to secure.  &lt;br /&gt;&lt;br /&gt;So I have 16+ Cisco devices from Routers to switches (2950s, 3550s, 2621s, 2651s, 3750s, 4912s and even an AS5300) all in my lab.  So with all those in my lab I got myself a DIGI portserver TS 16 Rack mount device (we use them for kernel debugging also).  With a special digi to cisco cable (yes I will give you the pin-outs if you want them) I connect each cisco's console port to the digi and then the DIGI's Ethernet port to my "management network".  The management network is where my management workstation lives.&lt;br /&gt; &lt;br /&gt;The digi device will let you telnet or ssh (SSH is better) into it.  Then from there connect to each of its ports (using the connect command).  Now where the fun comes in is how to setup the DIGI to talk to the cisco.  Then create a menu so you dont alway have to know the port number each device is connected to.  &lt;br /&gt;&lt;br /&gt;So below are the steps to allow you to connect the DIGI to the cisco (once you have the cable).  &lt;br /&gt;1.Make sure your device is up to date.  I am using 82000685_E.bin and 82000684_L.bin&lt;br /&gt;2.Know your port numbers (we are going to use ports 1-16)&lt;br /&gt;3.Set the port type to printer (set ports range=1-16 dev=prn)&lt;br /&gt;4.set the ip on your digi (set config dhcp=off ip=&lt;your IP&gt; submask=&lt;mask&gt;)&lt;br /&gt; &lt;br /&gt;At this point you should be able to use "connect 1" and connect to port 1.  A few hits of the enter key and it should show you the cisco console.&lt;br /&gt; &lt;br /&gt;Now we need to secure the device a little more by turning off things that are not needed. This will leave only telnet and ssh on (I would turn off telnet also but if you dont have an ssh client then it is kinda hard to use).&lt;br /&gt; 1.set secureaccess http=off snmp=off rlogin=off rsh=off https=off realport=off securerealport=off &lt;br /&gt;2.set secureaccess reversessh=off securesockets=off reversetcp=off reversetelnet=off &lt;br /&gt;&lt;br /&gt;We need to make our menu before we assign a user to use it.  This will be an example of ports 1-3 with a title bar&lt;br /&gt; 1.set menu range=1 t1="Cisco management" t2="Make sure you save!" name=menu1&lt;br /&gt;2.set menu range=1 m1="cisco 1" c1="connect 1"&lt;br /&gt;3.set menu range=1 m2="cisco 2" c2="connect 2"&lt;br /&gt;4.set menu range=1 m3="cisco 3" c3="connect 3"&lt;br /&gt; &lt;br /&gt;Now lets make a user that we will connect with to see our menu &lt;br /&gt;1.set user name=&lt;username&gt; defaultaccess=menu menu=1&lt;br /&gt; &lt;br /&gt;Set the password for our new digi user&lt;br /&gt; 1.newpass name=&lt;username&gt;&lt;br /&gt; &lt;br /&gt;Now a little know tip.  When use the default escape char with digi it will leave the port open and not let you reconnect until you do a kill tty=&lt;tty number&gt; (you can see the ttys by running the 'who' command).  But if you use the escapekill command (default is a . (that is a period)) then it will close the tty when you escape.  So the default escape command is "&lt;ctrl&gt;+]" &lt;without quotes&gt;.  Now add a period after that and hit enter and you will kill the connection not just disconnect so a "&lt;ctrl&gt;+].&lt;enter&gt;".  Now you press the control and ] key in one key stroke then the period in another.&lt;br /&gt; &lt;br /&gt;Now you should be able to telnet or ssh into your ip and get a menu.  Press 1 to connect cisco 1, 2 to connect to cisco 2, and 3 to connect to cisco 3.  &lt;br /&gt;&lt;br /&gt;How great!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-4190525320853845073?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/managing-lots-of-cisco-consoles-from.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-1719602647380543736</guid><pubDate>Sat, 18 Jun 2011 19:13:00 +0000</pubDate><atom:updated>2011-07-17T14:47:07.007-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><title>Disk Quota and .net (WMI and Microsoft.DiskQuota.1)</title><description>Repost from old Blog&lt;br /&gt;&lt;br /&gt;Today I had a con-call to talk about disk quota and how to automate the setting and reading of Quota.  So i thought that I would post a little about Disk quota stuff.&lt;br /&gt;&lt;br /&gt;There are 2 okay options.  &lt;br /&gt;&lt;br /&gt;#1 WMI (way to slow for a lot of things (&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/disk_quota_provider.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/disk_quota_provider.asp&lt;/a&gt;))&lt;br /&gt;&lt;br /&gt;#2 Microsoft.DiskQuota.1&lt;br /&gt;&lt;br /&gt;So my team needed a way to enumerate a users current quota limits and then + or - from them.  WMI was very slow to do this.  But DiskQuota.1 is quite fast.  It is not well documented that it works on remote servers either.  So I wrote a little something up.&lt;br /&gt;&lt;br /&gt;So here is some cs (and vb.net) that has functions on how to get and set quota info with Microsoft.diskquota.1&lt;br /&gt;&lt;br /&gt;CSharp: &lt;a href="http://dl.dropbox.com/u/3275573/blog/QuotaFunctions.cs.txt"&gt;http://dl.dropbox.com/u/3275573/blog/QuotaFunctions.cs.txt&lt;/a&gt;&lt;br /&gt;VB.NET: &lt;a href="http://dl.dropbox.com/u/3275573/blog/QuotaFunctions.vb.txt"&gt;http://dl.dropbox.com/u/3275573/blog/QuotaFunctions.vb.txt&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-1719602647380543736?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/disk-quota-and-net-wmi-and.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-1643524384995059614</guid><pubDate>Sat, 18 Jun 2011 19:04:00 +0000</pubDate><atom:updated>2011-06-18T12:04:16.415-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>Regular Expressions and IP addresses (ipv4 and IPv6)</title><description>Repost from old blog&lt;br /&gt;&lt;br /&gt;Over the last year or so I have been writing automation that uses IPv4 and IPv6 addresses.  In the beginning I had to dig up and make some regular expressions for verifying that a given value was a valid IPv4 or IPv6 address.  &lt;br /&gt;&lt;br /&gt;The ones I came up with are (in VB.net)&lt;br /&gt; &lt;br /&gt;Const strIPv4Pattern as string = "\A(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z" 'IPv4 Address Regex pattern (x.x.x.x)&lt;br /&gt; &lt;br /&gt;Const strIPv6Pattern as string = "\A(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\z"&lt;br /&gt; &lt;br /&gt;Const strIPv6Pattern_HEXCompressed as string = "\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)\z"&lt;br /&gt; &lt;br /&gt;Const StrIPv6Pattern_6Hex4Dec as string = "\A((?:[0-9A-Fa-f]{1,4}:){6,6})(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z"&lt;br /&gt; &lt;br /&gt;Const StrIPv6Pattern_Hex4DecCompressed as string = "\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::((?:[0-9A-Fa-f]{1,4}:)*)(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z"&lt;br /&gt; &lt;br /&gt;Now because an IPv6 address can take a few forms we have 4 different expressions for IPv6.  If someone finds a bug in one of these please let me know.  Because RegExp is something that I am not good at.  &lt;br /&gt;&lt;br /&gt;Hope these will help some one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-1643524384995059614?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/regular-expressions-and-ip-addresses.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-2268542757549115519</guid><pubDate>Sat, 18 Jun 2011 19:02:00 +0000</pubDate><atom:updated>2011-06-18T12:02:43.524-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>System Config</category><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>IPv6 6over4 tunnels with Windows and Cisco</title><description>Repost from old blog&lt;br /&gt;A few years ago I began working with Art Shelest here at Microsoft to get Native IPv6 running in my lab.&amp;nbsp; After a few weeks we had it up and running.&amp;nbsp; &lt;br /&gt;We had to work with MSIT (was known as ITG at the time) to get a 6over4 tunnel setup so that we could connect to the 6bone even though my upstream routers did not support IPv6 (still don't at this time).&amp;nbsp; Once the tunnel was setup on the&amp;nbsp;ITG Router we ran a command on my Windows IPv6 Router in my lab and it was up and running.&amp;nbsp; &lt;br /&gt;We run our entire lab IPv6 network on Windows Routers.&amp;nbsp; We use Windows Server 2003 but you could use Windows XP Pro if you wanted.&amp;nbsp; Unlike RRAS the IPv6 routing stack is included in Windows XP.&amp;nbsp; And after Windows XP SP1 this stack was fully supported by Microsoft support.&amp;nbsp; So if you follow the steps at &lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_imp_lab_node.mspx"&gt;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_imp_lab_node.mspx&lt;/a&gt;&amp;nbsp;you can get your internal test network setup.&lt;br /&gt;Now to create a 6over4 tunnel to another router you simply run the below commands from a cmd prompt on your main IPv6&amp;nbsp; router&lt;br /&gt;&lt;ol&gt;&lt;li&gt;netsh&lt;/li&gt;&lt;li&gt;int ipv6&lt;/li&gt;&lt;li&gt;add v6v4tunnel interface="V6v4 Tunnel" localaddress=&amp;lt;local ipv4 address&amp;gt; remoteaddress=&amp;lt;remote ipv4 address&amp;gt;&lt;/li&gt;&lt;li&gt;set interface "v6v4 Tunnel for=en&lt;/li&gt;&lt;li&gt;add address int="v6v4 tunnel" address=&amp;lt;IPv6 address from provider&amp;gt;&lt;/li&gt;&lt;li&gt;add route ::/0 "v6v4 tunnel" &amp;lt;remote IPv6 address&amp;gt; publish=yes&lt;/li&gt;&lt;/ol&gt;Key things to note with the above&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Local IPv4 address is the IP address that the tunnel is going to use to talk to the Upstream V6 Router (With my example below it would be 1.1.1.1).&amp;nbsp; &lt;/li&gt;&lt;li&gt;The Remote IPv4 Address is the IP address of the upstream V6 router (with my example below it would be 2.2.2.1).&lt;/li&gt;&lt;li&gt;The IPv6 address from provider would be a IPv6 address that you get from your v6 provider (with my example below it would be 3ffe:ffee:100:2::2)&lt;/li&gt;&lt;li&gt;The Remote IPv6 address is the IPv6 address of the upstream IPv6 router (with my example below it would be &lt;span style="font-family: Arial; font-size: x-small;"&gt;3FFE:FFEE:100:2::1)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;The Cisco side of the config looks like this&lt;br /&gt;&lt;span class="883125323"&gt;&lt;span font-size: x-small;"&gt;interface Tunnel1&lt;br /&gt;&amp;nbsp;description v6in4 tunnel to&amp;nbsp; lab 1.1.1.1/3FFE:FFEE:100:2::2&lt;br /&gt;&amp;nbsp;no ip address&lt;br /&gt;&amp;nbsp;ipv6 address 3FFE:FFEE:100:2::1/64&lt;br /&gt;&amp;nbsp;tunnel source&amp;nbsp;2.2.2.1&lt;br /&gt;&amp;nbsp;tunnel destination&amp;nbsp;1.1.1.1&lt;br /&gt;&amp;nbsp;tunnel mode ipv6ip&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="883125323"&gt;&lt;span font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="883125323"&gt;&lt;span  font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;Once the machines are all setup important things to know are "how do you back up your ipv6 configuration?" Well with netsh it could not be easier.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="883125323"&gt;&lt;span  font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;Simply run 'netsh int ipv6 dump &amp;gt; c:\ipv6backup.txt'&amp;nbsp; this will dump all the ipv6 config out to the txt file.&amp;nbsp; Now if the router was to ever go down you can run the command&amp;nbsp; 'netsh exec c:\ipv6backup.txt'.&amp;nbsp;&amp;nbsp; With these 2 commands it will backup and restore your ipv6 configuration..&amp;nbsp; You can also modify the backup command to be 'netsh dump &amp;gt; c:\netshbackup.txt' and it will back up 99% of all the settings for your network configuration.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="883125323"&gt;&lt;span  font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;If you would like to know more about how I have my IPv6 network setup please let me know.&amp;nbsp; Also&amp;nbsp;I recommend the Microsoft Press Book Understanding IPv6&amp;nbsp;(&lt;/span&gt;&lt;a href="http://www.microsoft.com/MSPress/books/4883.asp"&gt;&lt;span style="font-size: small;"&gt;http://www.microsoft.com/MSPress/books/4883.asp&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: small;"&gt;) ISBN: 0-7356-1245-5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="883125323"&gt;&lt;span  font-family: Arial; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-2268542757549115519?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/ipv6-6over4-tunnels-with-windows-and.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-5611096814573397299</guid><pubDate>Sat, 18 Jun 2011 18:59:00 +0000</pubDate><atom:updated>2011-06-18T11:59:34.910-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><title>How does IIS generate the Site ID?</title><description>Repost from old blog&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So in IIS 6 (and maybe IIS 7) when you create a new site programmatically you have the option to specify a SiteID or you can let IIS 6 do it for you.&amp;nbsp; &lt;/p&gt;&lt;p&gt;If you let it do it for you it will make this kinda hash of the site name.&amp;nbsp; You have to use this ID when you are doing any modifications to the site (programmatically).&amp;nbsp; So it would be the value in IIS://&amp;lt;servername&amp;gt;/W3SVC/&amp;lt;SiteID&amp;gt;&lt;/p&gt;&lt;p&gt;So how do you get the SiteID? &lt;/p&gt;&lt;ul&gt;    &lt;li&gt;Well you could create the site then enumerate it from WMI or ADSI.&amp;nbsp; &lt;/li&gt;    &lt;li&gt;Use my little c# function below to generate the sitename&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;blockquote&gt;&lt;font size="2"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;static&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;uint&lt;/font&gt;&lt;font size="2"&gt; GenerateSiteID(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SiteName) &lt;br /&gt;{ &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;uint&lt;/font&gt;&lt;font size="2"&gt; id = 0; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;char&lt;/font&gt;&lt;font size="2"&gt;[] arr = SiteName.ToCharArray(); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Convert the sitename to a Char Array&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;for&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; i = 0; i &amp;lt; arr.Length; i++)&lt;br /&gt;{ &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;char&lt;/font&gt;&lt;font size="2"&gt; c = arr[i]; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; intc = c; &lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; upper = intc &amp;amp; &lt;/font&gt;&lt;font color="#800000" size="2"&gt;'\x00df'&lt;/font&gt;&lt;font size="2"&gt;; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Upper case the letter&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;id = (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;uint&lt;/font&gt;&lt;font size="2"&gt;)(id * 101) + (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;uint&lt;/font&gt;&lt;font size="2"&gt;)upper; &lt;br /&gt;} &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;font size="2"&gt; (id % &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Int32&lt;/font&gt;&lt;font size="2"&gt;.MaxValue) + 1; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;//do a MOD and add 1 &lt;/font&gt;&lt;font size="2"&gt;&lt;br /&gt;}&lt;/font&gt; &lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Now a good thing to remember is that this might not be the sitename the IIS is using.&amp;nbsp; If there is a SiteID collision then IIS will try to move the ID up by 1 digit then try again.&amp;nbsp; So dont let this be the end all be all of how this is determined.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Using the code above is much faster then parsing through all the sites via ADSI or WMI to get the siteID.&amp;nbsp; So if you have 2000 sites on a server the site was created most recently (bottom of the Metabase)&amp;nbsp;will take longer to query for then the first site created (top of the metabase).&amp;nbsp;&lt;/p&gt;&lt;p&gt;Also note that if you try to convert this code to VB.net you will get an exception becasue VB.net does more bounds checking.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-5611096814573397299?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/how-does-iis-generate-site-id.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-5863211987576519723</guid><pubDate>Sat, 18 Jun 2011 18:57:00 +0000</pubDate><atom:updated>2011-06-18T11:57:24.493-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>How to speed up Queries to MicrosoftDNS with WMI</title><description>Repost from old blog&lt;br /&gt;&lt;br /&gt;So there are many key things to remember when creating your WMI queries make them as specific as you can.&lt;br /&gt; &lt;br /&gt;For example if you have ~5000 zones on your Microsoft DNS server and you are looking to see if a single record exists in one of those zones the wrong query could take 1 min+ to complete. &lt;br /&gt;&lt;br /&gt;Why? &lt;br /&gt;&lt;br /&gt;If you do a query like Select * from MicrosoftDNS_AType where ownername="www.mydomain.com" it is going to take a while.  Because you did not specify where to look for this record it is going to look in the RootHints and in the DNS Cache also.  So if you have a public DNS server that does recursive lookups it could have a few hundred thousand extra records. &lt;br /&gt;&lt;br /&gt;So a better query would be Select TextRepresentation from MicrosoftDNS_AType where containername="mydomainname" and domainname="mydomain.com" and ownername=www.mydomain.com&lt;br /&gt; &lt;br /&gt;You can use a vbscript like the one below to test your queries.  This will show you the correct domainname and other settings to use in your query.  You can remove the where clause to show all the data on the server.&lt;br /&gt; &lt;br /&gt;The containername will be the name of the zone that holds the records that you want to query for (Ie mydomain.com).  If you leave the containername empty it will also search through the DNS cache.  &lt;br /&gt;&lt;br /&gt;The domainname specifies the child folder (don’t know how else to describe it).  So if you have www.user.mydomain.com the domainname is user.mydomain.com&lt;br /&gt; &lt;br /&gt;Now the domainname will change depending on if there are sub domains to the subdomain (ie www from example above).  So if www does not exist then the domainname is mydomain.com.  And of course there are exceptions to this rule.  If there ever was a child to the sub (you deleted www but left user.mydomain.com) then the domainname is user.mydomain.com.  If you don’t want to attempt to do the logic around making sure you have the correct domainname you can omit it.  But if you have a large number of records it could make it slow.  &lt;br /&gt;&lt;br /&gt;Like SQL the order of the statements in the query is also important. &lt;br /&gt;&lt;br /&gt;If you know the full record info (hostname, TYPE, data) it is fastest to generate the text representation and query on that.  You can do that by adding changing your query to something like: &lt;br /&gt;&lt;br /&gt;Select * from MicrosoftDNS_AType where  containername=”test.com” and domainname=”test.com” and TextRepresentation="test.com IN A 192.168.0.1"&lt;br /&gt; &lt;br /&gt;&lt;code&gt;&lt;br /&gt; &lt;br /&gt;on error resume next&lt;br /&gt; servername = "."&lt;br /&gt; domainname = "test.com"&lt;br /&gt; &lt;br /&gt;recordtype = "A"&lt;br /&gt; &lt;br /&gt;set dnsserver = Getobject("winmgmts:{Authenticationlevel=pktPrivacy}!\\" &amp; servername &amp; "\root\MicrosoftDNS")&lt;br /&gt; &lt;br /&gt;query = "Select * from MicrosoftDNS_" &amp; recordtype &amp; "Type where containername=""" &amp; domainname &amp; """"&lt;br /&gt; wscript.echo "Query=" &amp; query &lt;br /&gt;&lt;br /&gt;Set colItems = dnsserver.ExecQuery(query,,48)&lt;br /&gt; if colitems.count &lt;&gt; 0 then&lt;br /&gt; For Each objItem in colItems&lt;br /&gt; Wscript.Echo "ContainerName: " &amp; objItem.ContainerName&lt;br /&gt; Wscript.Echo "DnsServerName: " &amp; objItem.DnsServerName&lt;br /&gt; Wscript.Echo "DomainName: " &amp; objItem.DomainName&lt;br /&gt; Wscript.Echo "OwnerName: " &amp; objItem.OwnerName&lt;br /&gt; Wscript.Echo "PrimaryName: " &amp; objItem.PrimaryName&lt;br /&gt; Wscript.Echo "RecordClass: " &amp; objItem.RecordClass&lt;br /&gt; Wscript.Echo "RecordData: " &amp; objItem.RecordData&lt;br /&gt; Wscript.Echo "TextRepresentation: " &amp; objItem.TextRepresentation&lt;br /&gt; Wscript.Echo "Timestamp: " &amp; objItem.Timestamp&lt;br /&gt; Wscript.Echo "TTL: " &amp; objItem.TTL&lt;br /&gt; Next&lt;br /&gt; end if&lt;br /&gt; &lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-5863211987576519723?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/how-to-speed-up-queries-to-microsoftdns.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-5749379760973438501</guid><pubDate>Sat, 18 Jun 2011 18:55:00 +0000</pubDate><atom:updated>2011-06-18T11:55:32.622-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>System Config</category><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>L2TPv3 performance tweaks for HyperV GeoCluster Live Migration</title><description>&lt;div&gt;L2TPv3 is a great feature for extending a Layer2 network across sites.&amp;nbsp;This is very useful when you are using Live Migration with HyperV or when you want to pass traffic (at Layer 2) to a different location.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Recently while working on a SAN GeoClustering test case we want to do a stretched VLan from one lab to another (in different buildings).&amp;nbsp;This gets tricky because we (my team) don&amp;rsquo;t own or manage the network infrastructure between these buildings.&amp;nbsp;Many companies will use MPLS/VPLS to create a VPN or VLL (Virtual Leased Line) between two sites.&amp;nbsp;This can be expensive and a pain to get setup if you only need a link for a short period of time.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Stretched VLans are becoming more and more common as feature like Live Migration allow the moving of a system from one datacenter to another at the push of a button (well mouse clicks).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The setup:&lt;/div&gt;&lt;div&gt;Sites: We were testing at labs that are about &amp;amp;frac14; of a mile apart from each other on opposite sides of Main Campus&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;The test network consisted for 4 vlans.&amp;nbsp;These networks were duplicated at both sites&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Public -- internet facing for request to HyperV hosted servers&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Cluster &amp;ndash; heartbeat network for Fail over Cluster&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Live Migration &amp;ndash; network to pass server state during live migration &lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Management &amp;ndash; backend network to access remove desktop to servers and devices&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Servers: We had 6 physical servers for the test (3 at each site).&amp;nbsp;Each site had the same setup for servers&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Server 1 &amp;ndash; Host infrastructure systems (AD, DNS, DHCP, WDS)&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Server 2 &amp;amp;3 &amp;ndash; Fail over cluster hosts that would host the workload VMs&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;To interconnect the 4 vlans across buildings we uses the existing IPv4 infrastructure and 2 cisco routers.&amp;nbsp;The building infrastructure offers &amp;gt; 1gbps in an out of each lab, so we connected with 1gig interfaces to uplinks.&amp;nbsp;We also do not have visibility into MTU on building (intra and inter) infrastructure.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;So down to what we found and what we changed:&lt;/div&gt;&lt;div&gt;Original Setup (poor performance): - config shown below&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Single L2TPv3 Tunnel between sites&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Lab facing interfaces were connected to switch that was a trunk port allowing our 4 VLans&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Switchport mode trunk&lt;/div&gt;&lt;div&gt;Original design findings:&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Traffic passed (with 802.1q tags) correctly through tunnel&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MAX bandwidth when coping files/Live Migration from site to site was 20-30mbps&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Large amount of dropped packets in queue&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;CPU maxed at 100%&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Tweaked design (best performance)&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;4 tunnels (one for each vlan) using sub interfaces&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;No change to switch trunk config&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Modified hold-queue on each physical interface&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Enabled MTU tuning on pseudowire-class (ip pmtu)&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Enabled Don&amp;rsquo;t Fragment bit on pseudowire-class (ip dfbit set)&lt;/div&gt;&lt;div&gt;Tweaked design Findings:&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Traffic passed correctly through tunnel&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Each VLan correctly mapped on either side&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MAX bandwidth when coping files/Live Migration from site to site was ~800mbps&lt;/div&gt;&lt;div&gt;&lt;span&gt;&amp;middot;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;CPU would be around 40%&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Original Config (each site was identical except swapped xconnect ip with interface ip address) &amp;ndash; SLOW!&lt;/div&gt;&lt;div&gt;---&lt;/div&gt;&lt;div&gt;l2tp-class class1&lt;/div&gt;&lt;div&gt;authentication&lt;/div&gt;&lt;div&gt;password 0 123456789&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;pseudowire-class ethernet&lt;/div&gt;&lt;div&gt;encapsulation l2tpv3&lt;/div&gt;&lt;div&gt;protocol l2tpv3 class1&lt;/div&gt;&lt;div&gt;ip local interface GigabitEthernet0/1&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/0&lt;/div&gt;&lt;div&gt;no ip address&lt;/div&gt;&lt;div&gt;duplex full&lt;/div&gt;&lt;div&gt;speed auto&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;xconnect 10.216.44.47 125 pw-class ethernet&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/1&lt;/div&gt;&lt;div&gt;ip address 10.197.251.215 255.255.255.240&lt;/div&gt;&lt;div&gt;duplex auto&lt;/div&gt;&lt;div&gt;speed auto&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;ip route 0.0.0.0 0.0.0.0 10.197.251.209&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;no cdp run&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;End&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Tweaked Design&lt;/div&gt;&lt;div&gt;--&lt;/div&gt;&lt;div&gt;l2tp-class class1&lt;/div&gt;&lt;div&gt;authentication&lt;/div&gt;&lt;div&gt;password 0 123456789&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;pseudowire-class ethernet&lt;/div&gt;&lt;div&gt;encapsulation l2tpv3&lt;/div&gt;&lt;div&gt;protocol l2tpv3 class1&lt;/div&gt;&lt;div&gt;ip local interface GigabitEthernet0/1&lt;/div&gt;&lt;div&gt;ip pmtu&lt;/div&gt;&lt;div&gt;ip dfbit set&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/0&lt;/div&gt;&lt;div&gt;no ip address&lt;/div&gt;&lt;div&gt;duplex full&lt;/div&gt;&lt;div&gt;speed auto&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;hold-queue 2048 in&lt;/div&gt;&lt;div&gt;hold-queue 2048 out&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/0.2996&lt;/div&gt;&lt;div&gt;encapsulation dot1Q 2996&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;xconnect 10.216.44.47 126 encapsulation l2tpv3 pw-class ethernet&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/0.2997&lt;/div&gt;&lt;div&gt;encapsulation dot1Q 2997&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;xconnect 10.216.44.47 127 encapsulation l2tpv3 pw-class ethernet&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/0.2998&lt;/div&gt;&lt;div&gt;encapsulation dot1Q 2998&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;xconnect 10.216.44.47 128 encapsulation l2tpv3 pw-class ethernet&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/0.2999&lt;/div&gt;&lt;div&gt;encapsulation dot1Q 2999&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;xconnect 10.216.44.47 125 encapsulation l2tpv3 pw-class ethernet&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;interface GigabitEthernet0/1&lt;/div&gt;&lt;div&gt;ip address 10.197.251.215 255.255.255.240&lt;/div&gt;&lt;div&gt;duplex auto&lt;/div&gt;&lt;div&gt;speed auto&lt;/div&gt;&lt;div&gt;no cdp enable&lt;/div&gt;&lt;div&gt;hold-queue 2048 in&lt;/div&gt;&lt;div&gt;hold-queue 2048 out&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;ip route 0.0.0.0 0.0.0.0 10.197.251.209&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;no cdp run&lt;/div&gt;&lt;div&gt;!&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-5749379760973438501?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/l2tpv3-performance-tweaks-for-hyperv.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-2823531503681182444</guid><pubDate>Sat, 18 Jun 2011 18:52:00 +0000</pubDate><atom:updated>2011-07-17T14:36:55.875-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Programming</category><category domain='http://www.blogger.com/atom/ns#'>Networking</category><title>Programmatically Controlling Pioneer Receivers and BluRay Players</title><description>I recently got a new Pioneer Elite SC-35 receiver (&lt;a href="http://www.pioneerelectronics.com/PUSA/Products/HomeEntertainment/AV-Receivers/EliteReceivers/ci.SC-35.Kuro"&gt;http://www.pioneerelectronics.com/PUSA/Products/HomeEntertainment/AV-Receivers/EliteReceivers/ci.SC-35.Kuro&lt;/a&gt;).&amp;nbsp; This receiver has an&amp;nbsp;ethernet plug&amp;nbsp;on the rear and is supported by the&amp;nbsp;iPhone/iPOD app called iControlAV.&amp;nbsp; &lt;br /&gt;While the receiver has a web interface called "Pioneer Web Control System" I wanted a way to control this receiver via script.&amp;nbsp;The web interface has support for &lt;br /&gt;&lt;ul&gt;&lt;li&gt;Powering the receiver on/off&lt;/li&gt;&lt;li&gt;Changing the Volume including mute&lt;/li&gt;&lt;li&gt;Changing the Input (Zones 1-3)&lt;/li&gt;&lt;li&gt;Changing the "Listening Mode" &lt;/li&gt;&lt;/ul&gt;The iControlAV app for iPhone supports the same plus a few more options.&lt;br /&gt;The iControlAV uses SSDP query to find the receiver.&amp;nbsp;Which runs NU-OS 1.13.&amp;nbsp; You can Browse to &lt;a href="http://%3creceiver%20ip%3e/BasicDevice.xml"&gt;http://&amp;lt;Receiver IP&amp;gt;/BasicDevice.xml&lt;/a&gt;&amp;nbsp;to get the info on your device.&amp;nbsp; &lt;br /&gt;My receiver has port 23 (telnet) open along with 80 and 8102 (referenced in BasicDevice.xml)&lt;br /&gt;Basic process:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Send command as ASCII on telnet (23)&amp;nbsp;or TCP/8102 (see your BasicDevice.xml)&lt;/li&gt;&lt;li&gt;Commands that check status or query the device begin with a ?&lt;/li&gt;&lt;li&gt;Commands that perform a command sometimes have parameters (input number) at begining, some at end&lt;/li&gt;&lt;li&gt;You can monitor the telnet&amp;nbsp;window to see the "response" for each command sent.&amp;nbsp; This includes commands sent through IR remote or from the device its self.&lt;/li&gt;&lt;/ul&gt;Basic Commands (more commands to come in another post):&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;             &lt;td&gt;?P&lt;/td&gt;             &lt;td&gt;&lt;br /&gt;Is Device powered ON?&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;PWR0&lt;/td&gt;                         &lt;td&gt;Device is ON&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;PWR1&lt;/td&gt;                         &lt;td&gt;Device is OFF&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;PF&lt;/td&gt;             &lt;td&gt;Power Device OFF&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;PO&lt;/td&gt;             &lt;td&gt;Power Device ON&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?M&lt;/td&gt;             &lt;td&gt;&amp;nbsp;Is Zone MAIN muted&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;MUT1&lt;/td&gt;                         &lt;td&gt;Zone is NOT Muted&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;MUT0&lt;/td&gt;                         &lt;td&gt;Zone is Muted&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;MO&lt;/td&gt;             &lt;td&gt;&amp;nbsp;Mute MAIN zone&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;MF&lt;/td&gt;             &lt;td&gt;&amp;nbsp;unMute MAIN zone&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?V&lt;/td&gt;             &lt;td&gt;Get Current Volume level&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;VOLxxx&lt;/td&gt;                         &lt;td&gt;Current volume level, xxx is 000-200&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;VOL121&lt;/td&gt;                         &lt;td&gt;-20.0db&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;VOL081&lt;/td&gt;                         &lt;td&gt;-40.0db&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;XXXVL&lt;/td&gt;             &lt;td&gt;Set Volume Level to XXX (000 - 200)&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;001VL&lt;/td&gt;             &lt;td&gt;Set Volume Level to -80.0db&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;081VL&lt;/td&gt;             &lt;td&gt;Set Volume Level to -40.0db&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?RGC&lt;/td&gt;             &lt;td&gt;Get inputs on device (i think)&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;RGC111001002&lt;/td&gt;                         &lt;td&gt;*Unknown*&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?RGBxx&lt;/td&gt;             &lt;td&gt;Get inputs Name (related to above command), available inputs will change based on model&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;?RGB01&lt;/td&gt;                         &lt;td&gt;RGB010CD&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;?RGB02&lt;/td&gt;                         &lt;td&gt;RGB020TUNER&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;?RGB03&lt;/td&gt;                         &lt;td&gt;RGB030CD-R/TAPE&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?F&lt;/td&gt;             &lt;td&gt;Get current input (use ?RGB to get name)&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;FN19&lt;/td&gt;                         &lt;td&gt;Input 19&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;FN15&lt;/td&gt;                         &lt;td&gt;Input 15&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;XXFN&lt;/td&gt;             &lt;td&gt;Set current input (XX = Input number)&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;XX&lt;/td&gt;                         &lt;td&gt;Input number&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;19FN&lt;/td&gt;                         &lt;td&gt;Set to input 19&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;15FN&lt;/td&gt;                         &lt;td&gt;Set to input 15&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?BP&lt;/td&gt;             &lt;td&gt;*UNKNOWN*&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;BPR1&lt;/td&gt;                         &lt;td&gt;&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;&lt;/td&gt;                         &lt;td&gt;&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;tr&gt;             &lt;td&gt;?AP&lt;/td&gt;             &lt;td&gt;*UNKNOWN*&lt;br /&gt;&lt;table border="1" cellpadding="1" cellspacing="1" summary=""&gt;&lt;tbody&gt;&lt;tr&gt;                         &lt;td&gt;APR1&lt;/td&gt;                         &lt;td&gt;&lt;/td&gt;                     &lt;/tr&gt;&lt;tr&gt;                         &lt;td&gt;&lt;/td&gt;                         &lt;td&gt;&lt;/td&gt;                     &lt;/tr&gt;&lt;/tbody&gt;             &lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;Example&lt;br /&gt;Turn on device, set input to HDMI1 (19 in my case), and volume to -40db&lt;br /&gt;&lt;br /&gt;PO&lt;br /&gt;&lt;br /&gt;19FN&lt;br /&gt;&lt;br /&gt;081VL&lt;br /&gt;&lt;br /&gt;(Update: 7/17/2011)&lt;br /&gt;I was able to find a doc that has all the commands (better than what I was able to determine).&amp;nbsp; &lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/3275573/2010%20USA%20AVR%20RS-232C%20%26%20IP%20Commands%20for%20CI.pdf"&gt;http://dl.dropbox.com/u/3275573/2010%20USA%20AVR%20RS-232C%20%26%20IP%20Commands%20for%20CI.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-2823531503681182444?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/programmatically-controlling-pioneer.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-3693837124117371034</guid><pubDate>Sat, 18 Jun 2011 18:51:00 +0000</pubDate><atom:updated>2011-06-18T11:51:28.973-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>System Config</category><title>Configuring Dell EqualLogic management interface</title><description>&lt;div&gt; The Dell EqualLogic iSCSI SAN supports an out-of-band management network interface. This is for managing the device from a separate network than the iSCSI traffic is on. &lt;/div&gt;&lt;div&gt;The documentation for the PS6000E is some of the worse I have ever seen. In addition to that the CLI (command line interface) is about as bad as a big pile of dog poo. &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;So this is a quick set of commands that are used to configure the management (eth2) interface on the device. The web interface is nice and all but you have to have your 10Gig network setup before you can access it. Also the "setup" does not really give you an easy option to configure the management interface.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Steps:&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Login to Console Port with grpadmin username and grpadmin password.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;After you run setup you will need to know the "member name". You can get your member name by running the "member show" command. This will list the name, Status, Version, Size information for each member configured on the array.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;grpname&amp;gt; member show&lt;/div&gt;&lt;div&gt;Name       Status Version    Disks Capacity   FreeSpace Connections&lt;/div&gt;&lt;div&gt;---------- ------- ---------- ----- ---------- ---------- -----------&lt;/div&gt;&lt;div&gt;EEC-DellEqual online V4.3.6 (R1 16    621.53GB   0MB        0&lt;/div&gt;&lt;div&gt; grpname&amp;gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;The member name for my device is EEC-DellEqual.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Once you know the member name you will need to set the IP address for your management interface. This IP address will need to be one that you can access from your management network. The port is an untagged port similar to other out-of-band management ports on devices (network switches).&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;To configure the IP use the member command again.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;First set the interface to be management ONLY&lt;/div&gt;&lt;div&gt;-member select EEC-DellEqual eth select 2 mgmt-only enable&lt;/div&gt;&lt;div&gt;Set the IP address and Network Mask&lt;/div&gt;&lt;div&gt;-member select EEC-DellEqual eth select 2 ipaddress xxx.xxx.xxx.xxx netmask 255.255.255.0&lt;/div&gt;&lt;div&gt;Enable the interface (by default the MGMT (eth2) interface is disabled and will not provide a LINK).&lt;/div&gt;&lt;div&gt;-member select EEC-DellEqual eth select 2 up&lt;/div&gt;&lt;div&gt;You will be asked to confirm that you wish to enable the Management port&lt;/div&gt;&lt;div&gt;This port is for group management only. If enabling, make sure it is connected to a dedicated management network. If disabling, make sure you can access the group through another Ethernet port.&lt;/div&gt;&lt;div&gt;Do you really want to enable the management interface? (y/n) [n] y&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;To view current IP and state of an Eth interface use&lt;/div&gt;&lt;div&gt;-member select &amp;lt;member Name&amp;gt; show eths&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Once that is complete you can use the management IP address to create an http or https connection to the Array.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-3693837124117371034?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/configuring-dell-equallogic-management.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-4830641179638078616.post-45075285277787099</guid><pubDate>Sat, 18 Jun 2011 18:14:00 +0000</pubDate><atom:updated>2011-06-18T11:50:47.446-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Security</category><title>Securing a TS connection with Smart Cards</title><description>Repost from old blog&lt;br /&gt;Well today is going to be a busy day here at the Microsoft Enterprise Engineering Center.  At about 11:30 I am going to have lunch some of the RedvsBlue people (&lt;a _fcksavedurl="http://www.redvsblue.com/" href="http://www.redvsblue.com/"&gt;&lt;span style="color: #0066cc;"&gt;http://www.redvsblue.com&lt;/span&gt;&lt;/a&gt;).  Then I have the job of setting up and testing a remote access solution for a customer.  &lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;Note that the steps below are technical and you should know a little something about Active Directory and PKI before you start.&lt;br /&gt;&lt;br /&gt;The problem:  How do you provide a customer secure remote access into a scenario? &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;Solution:  Smart cards and Terminal Services on Windows Server 2003! Smart cards keep the Private PKI key stored on the card, and cannot be removed from the card. It requires two-factor authentication.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;Something you have (the smart card) and something you know (the PIN).&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;How:  First we set up a DC (or 2).  Then install cert services on box (domain member).  Then install Terminal Services on to another box (aka the Jump box).  &lt;br /&gt;&lt;br /&gt;We are using the Microsoft Base CSP (&lt;a _fcksavedurl="http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/techref/en-us/Default.asp?url=/Resources/Documentation/windowsserv/2003/all/techref/en-us/w2k3tr_certs_how.asp" href="http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/techref/en-us/Default.asp?url=/Resources/Documentation/windowsserv/2003/all/techref/en-us/w2k3tr_certs_how.asp"&gt;&lt;span style="color: #0066cc;"&gt;http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/techref/en-us/Default.asp?url=/Resources/Documentation/windowsserv/2003/all/techref/en-us/w2k3tr_certs_how.asp&lt;/span&gt;&lt;/a&gt;) on some Amtel Smart cards.  &lt;br /&gt;&lt;br /&gt;I create user accounts in the Domain for each person that will need remote access.  Each Account has a Very LONG and Very RANDOM password.  This is because the user will never use a password.  They will not be able to use their smart card.  Once the users are created make sure that you go in the properties of each user and under the Account tab select the following options: User Cannot change password, Password never expires and Smart Card is required for interactive logon.  &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;Now create a separate Admin account.  This will be the account that I use to manage the TS (terminal Services) jump box and issue the smart cards. Make sure it has a secure password.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;To issue a smart card the issuing user account must have an Enrollment Agent Cert.  To get this cert you must first enable it on the CA.  (Open the CA MMC snapin -&amp;gt; select Certificate Templates -&amp;gt; Right-click on Certificate Templates -&amp;gt; Select New -&amp;gt; Select Certificate Template to issue.  In the list select Enrollment Agent.&lt;br /&gt;&lt;br /&gt;Repeat the steps above to also add the Smart Card Logon Cert.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;This is the cert that we will put on each Smart Card.&lt;br /&gt;&lt;br /&gt;After you have enabled that cert (Enrollment Agent) you must now request it with the user account that will be issuing the Smart Cards.  So for my solution that is the separate admin account.  I will use runas.exe /u:&amp;lt;domainName&amp;gt;\&amp;lt;adminUser&amp;gt; "mmc certmgr.msc".  This will allow me to open the MMC without logging in as that user.  &lt;br /&gt;&lt;br /&gt;To request the new cert select personal -&amp;gt; right-click on personal -&amp;gt; select all tasks -&amp;gt; select Request new Cert... Once the Wizard opens select Next to start it -&amp;gt; Select Enrollment Agent -&amp;gt; Select Next -&amp;gt; Enter a Name (like SC enrollment Cert) -&amp;gt; Select Next -&amp;gt; then Select Finish to issue the cert.&lt;br /&gt;&lt;br /&gt;Now we will need to make sure we have our smart card reader installed on the machine that has our enrollment Cert and http access to the CA.  With all of the above done you can now open a web browser to http://&amp;lt;CA Machine Name&amp;gt;/certsrv/certsces.asp (note: that you might have to add this site to your trusted sites to get the Active X control to load).&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From this browser window we can select the type of Cert we want to put on the Smart Card.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;We are going to use Smart Card Logon Cert.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;You will need to select the Microsoft Base Smart Card Crypto Provider as your CSP.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;The Administrator Signing Certificate is the Enrollment Cert that we requested earlier.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;At this point you can select any user in the domain to issue a smart card for.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One thing to note is that when you have a smart card for user account it does not matter if the user changes their password.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;The smart card will allow the user to be authenticated without a password.&lt;span style="mso-spacerun: yes;"&gt;  &lt;/span&gt;So make sure that you keep accounts that have the Enrollment Agent Cert secure.&lt;br /&gt;&lt;br /&gt;In the future I will also write about how to use the AD to further secure the Solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4830641179638078616-45075285277787099?l=www.mikepoulson.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mikepoulson.com/2011/06/securing-ts-connection-with-smart-cards.html</link><author>noreply@blogger.com (Mike Poulson)</author><thr:total>0</thr:total></item></channel></rss>
