<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUEAR3k9eCp7ImA9WxFaEU8.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515</id><updated>2010-07-14T10:14:06.760-07:00</updated><title>geekpoet</title><subtitle type="html">Geek-related ramblings</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.geekpoet.net/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Geekpoet" /><feedburner:info uri="geekpoet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;Dk8EQHoyfCp7ImA9WxFVF00.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-6676917254391652414</id><published>2010-06-16T09:13:00.000-07:00</published><updated>2010-06-16T09:13:21.494-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-16T09:13:21.494-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><category scheme="http://www.blogger.com/atom/ns#" term="WSUS" /><title>Powershell script to check for pending reboots (specifically for WSUS / Automatic Updates pending reboots)</title><content type="html">I've been looking for a reliable way to determine if servers I've pushed patches to via WSUS (we use a manually-activated scheduled tasks to forcibly apply pending patches) have triggered a pending reboot. &amp;nbsp;I did a quick google search and found a script by a gentleman named Moe Winnett over at&amp;nbsp;&lt;a href="http://www.techmumbojumblog.com/?p=375&amp;amp;cpage=1"&gt;http://www.techmumbojumblog.com/?p=375&amp;amp;cpage=1&lt;/a&gt;&amp;nbsp;that does 99% of what I needed. &amp;nbsp;It didn't include the paths needed for WSUS/Automatic Updates pending reboots so I added that (and sent them the additions).&lt;br /&gt;
&lt;br /&gt;
This is rough, and provided in case it helps anyone. &amp;nbsp;It actually will be part of a larger management script at some point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$Version = "wsus_rbquery.ps1 v10.6.14 Aaron Dodd"
$Usage = "Usage: wsus_rbquery.ps1 [servers], where [servers] is one or more servers to set up the tasks on (comma-separated if more than one) or a one-server-per line text file ending in .txt"
$Description = "Checks for pending reboots on target server(s)"

# Based on a script found at http://www.techmumbojumblog.com/?p=375&amp;amp;cpage=1

# Expects 1 or more (comma-delimited if more) servers
If (!$Args[0]) {
    Write-Host $Version
    Write-Host $Usage
    Write-Host $Description
    Exit
}

$Servers = $Args[0].ToLower()

If ($Servers.Contains(".txt")) {
    $Servers = gc $Servers 
} ElseIf ($Servers.Contains(",")) {
    $Servers = [regex]::Split($Servers,",")
}


function Get-PendingReboot {
    param([string]$computer)
 $hkey  = 'LocalMachine';
 $path_server = 'SOFTWARE\Microsoft\ServerManager';
    $path_wsus      = 'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired';
 $path_control = 'SYSTEM\CurrentControlSet\Control';
 $path_session = join-path $path_control 'Session Manager';
 $path_name = join-path $path_control 'ComputerName';
 $path_name_old = join-path $path_name 'ActiveComputerName';
 $path_name_new = join-path $path_name 'ComputerName';

 $pending_rename = 'PendingFileRenameOperations';
 $pending_rename_2 = 'PendingFileRenameOperations2';
 $attempts = 'CurrentRebootAttempts';
 $computer_name = 'ComputerName';

 $num_attempts = 0;
 $name_old = $null;
 $name_new = $null;

 $reg= [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($hkey, $computer);

 $key_session = $reg.OpenSubKey($path_session);
 if ($key_session -ne $null) {
  $session_values = @($key_session.GetValueNames());
        $key_session.Close() | out-null;
 }

 $key_server = $reg.OpenSubKey($path_server);
 if ($key_server -ne $null) {
  $num_attempts = $key_server.GetValue($attempts);
  $key_server.Close() | out-null;
 }

 $key_name_old = $reg.OpenSubKey($path_name_old);
 if ($key_name_old -ne $null) {
  $name_old = $key_name_old.GetValue($computer_name);
  $key_name_old.Close() | out-null;

  $key_name_new = $reg.OpenSubKey($path_name_new);
  if ($key_name_new -ne $null) {
   $name_new = $key_name_new.GetValue($computer_name);
   $key_name_new.Close() | out-null;
  }
 }
    
    $key_wsus = $reg.OpenSubKey($path_wsus);
 if ($key_wsus -ne $null) {
  $wsus_values = @($key_wsus.GetValueNames());
        if ($wsus_values) { 
            $wsus_rbpending = $true 
        } else {
            $wsus_rbpending = $false
        }
  $key_wsus.Close() | out-null;
 }

 $reg.Close() | out-null;

 if ( `
        (($session_values -contains $pending_rename) -or ($session_values -contains $pending_rename_2)) `
 -or (($num_attempts -gt 0) -or ($name_old -ne $name_new)) `
    -or ($wsus_rbpending)) {
  return $true;
 }
 else {
  return $false;
 }
}

ForEach ($Server in $servers) {
    Write-Host $Server - (Get-PendingReboot $Server)
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-6676917254391652414?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/r0E0WCIjoSg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/6676917254391652414/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=6676917254391652414" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/6676917254391652414?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/6676917254391652414?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/r0E0WCIjoSg/powershell-script-to-check-for-pending.html" title="Powershell script to check for pending reboots (specifically for WSUS / Automatic Updates pending reboots)" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.geekpoet.net/2010/06/powershell-script-to-check-for-pending.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYNRn4ycSp7ImA9WxBTE08.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-364978072421102506</id><published>2009-12-08T19:09:00.000-08:00</published><updated>2009-12-08T19:09:57.099-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-08T19:09:57.099-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="thunderbird" /><title>Importing Windows-based Outlook tasks into Mozilla Thunderbird/Lightning/Sunbird on OS X</title><content type="html">I usually track all work as Outlook tasks and keep work requests as the body/description of the task.&amp;nbsp; Its not the best workflow, but its easy and allows for the mostly-email-based requests to be quickly tagged, given a reminder/due date, and tracked.&lt;br /&gt;
&lt;br /&gt;
I decided to switch to Thunderbird for a variety of reasons, and the one thing I was really missing was how to get my tasks from Outlook into Thunderbird/Lightning.&amp;nbsp; The calendars were no problem as I have Outlook using the GoogleSync app from Google to keep that calendar in sync.&amp;nbsp; But tasks aren't supported that way.&lt;br /&gt;
&lt;br /&gt;
However, after way too much digging and surfing and tinkering, I realized that since I'm using OS X, specifically Snow Leopard, and it supports Exchange sync, the answers were built into my OS.&lt;br /&gt;
&lt;br /&gt;
To get my tasks from Outlook into Thunderbird I did the following:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;I set up Apple's iCal to use our corporate Exchange2007 server for calendar and tasks&lt;/li&gt;
&lt;li&gt;Once that was up, I went to the Finder and looked under my home folder, Library, Calendars&lt;/li&gt;
&lt;li&gt;There were a couple of folders with long GUID names (long numbers/letters separated by dashes) ending in ".calendar".&amp;nbsp; Expanding this showed a folder called "Events" which contained one .ics file for every task that was sync'd from Exchange&lt;/li&gt;
&lt;li&gt;I copied all of these .ics files to a temporary folder&lt;/li&gt;
&lt;li&gt;This step is optional, but I recommend it otherwise you're going to repeat the import steps for each .ics file: I then opened the terminal, changed to the folder with the .ics files, and typed "cat *.ics &amp;gt; merged.ics".&amp;nbsp; This took each of the individual .ics files and made them into one.&lt;/li&gt;
&lt;li&gt;In Thunderbird I went to the Calendar page, clicked "File / Import Calendar" and browsed to the "merged.ics" file above&lt;/li&gt;
&lt;/ul&gt;This didn't preserve file attachments (which I didn't expect to be preserved) or categories, but everything else seems to be in tact. &lt;br /&gt;
&lt;br /&gt;
I wish I knew of a more cross-platform solution, but since I use OS X this worked fine for me ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-364978072421102506?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/zv1HDIqOWc4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/364978072421102506/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=364978072421102506" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/364978072421102506?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/364978072421102506?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/zv1HDIqOWc4/importing-windows-based-outlook-tasks.html" title="Importing Windows-based Outlook tasks into Mozilla Thunderbird/Lightning/Sunbird on OS X" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.geekpoet.net/2009/12/importing-windows-based-outlook-tasks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04EQnY9fyp7ImA9WxNWEk4.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-8241238614991001173</id><published>2009-10-10T22:44:00.000-07:00</published><updated>2009-10-10T22:45:03.867-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-10T22:45:03.867-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><title>Powershell script to change local administrator password across multiple computers</title><content type="html">Ok, this is yet another script for changing local administrator passwords across most Windows servers and desktops (works on Windows 2000, 2003, 2008, XP, and Vista).  The difference here is in my quest to find one quickly, I stumbled across a bunch of VBScripts that are decent but overkill, so I ended up writing my own script that will:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Parse a list of server names&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Verify the server is online&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Only try to change the password if it is online&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Tell me if it succeeded, failed, or skipped a down system&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Fortunately, all of this is available in Powershell with little real effort.  Below is a quick script to do all of the above.  Before running it, be sure that:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The account you're running it under has administrative rights to each system.  If you're spanning domains without trusts, you should use the "Stored Usernames and Passwords" control panel to add your credentials for each domain (specify the resource as *.domain.name, and use FQDN's in step 2).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You create a list of servers, one per line, called "serverlist.txt" in the same folder from which you run the script (you can change the filename and path by editing the script below).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You change the placeholders below to have the proper local admin username and new password (we have a GPO to rename the administrator account, so I don't assume "Administrator")&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;The script:&lt;br /&gt;&lt;pre&gt;$erroractionpreference = "SilentlyContinue"&lt;br /&gt;foreach ($Computer in get-content serverlist.txt) {&lt;br /&gt;    $ServerName = $Computer.ToUpper()&lt;br /&gt;    &lt;br /&gt;    $ping = new-object System.Net.NetworkInformation.Ping&lt;br /&gt;    $Reply = $ping.send($Computer)&lt;br /&gt;    &lt;br /&gt;    if($Reply.status -eq "success") {&lt;br /&gt;        Write-Host "$ServerName is online"&lt;br /&gt;        $Admin=[adsi]("WinNT://" + $Computer + "/--ADMINUSERNAMEHERE--, user")&lt;br /&gt;        $Admin.PSBase.Invoke("SetPassword", "--NEWPASSWORDHERE--")&lt;br /&gt;        &lt;br /&gt;        # Verify password was just changed&lt;br /&gt;        $PasswordAge = $Admin.PasswordAge        &lt;br /&gt;        If($PasswordAge -ne $null) {            &lt;br /&gt;            Write-Host "$ServerName password change SUCCEEDED"        &lt;br /&gt;        } Else {&lt;br /&gt;            Write-Host "$ServerName password change FAILED"        &lt;br /&gt;        }&lt;br /&gt;    } Else {&lt;br /&gt;        Write-Host "$ServerName is not online - skipping"    &lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-8241238614991001173?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/Q7e83KoiM44" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/8241238614991001173/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=8241238614991001173" title="11 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/8241238614991001173?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/8241238614991001173?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/Q7e83KoiM44/powershell-script-to-change-local_10.html" title="Powershell script to change local administrator password across multiple computers" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>11</thr:total><feedburner:origLink>http://blog.geekpoet.net/2009/10/powershell-script-to-change-local_10.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EMSH08fCp7ImA9WxNSGEk.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-2183803094107435301</id><published>2009-09-01T14:48:00.000-07:00</published><updated>2009-09-01T14:48:09.374-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-01T14:48:09.374-07:00</app:edited><title>LogParser Lizard on Windows Vista x64, 2003 x64, 2008 x64</title><content type="html">The insanely useful "&lt;a href="http://www.lizardl.com/PageHtml.aspx?lng=2&amp;amp;PageId=18&amp;amp;PageListItemId=17"&gt;LogParser Lizard&lt;/a&gt;" from &lt;a href="http://www.lizardl.com/"&gt;LizardLabs&lt;/a&gt; is something I use daily to parse logs across our server farms (i.e. did that email from someluser@somecompany.com actually leave one of the dozen front end mail servers?&amp;nbsp; Did we get any FTP error code 426's for the past week anywhere on the FTP server farm?).&amp;nbsp; It's a front-end to &lt;a href="http://www.microsoft.com/DownLoads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;amp;displaylang=en"&gt;Microsoft's LogParser.exe&lt;/a&gt; so it reads pretty much any log format used on Windows, plus some niceties like AD querying, SQL DB querying, and making pretty charts out of the results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The issue is the server I run it from is Windows 2003 32-bit.&amp;nbsp; When I tried to run it from our new management server, 2008 x64, or from any of the 64-bit 2003 servers, it would seem to start, then crash.&amp;nbsp; I'd see the following error in the event log:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;Faulting application log parser lizard.exe, version 1.0.0.0, stamp 48565da6, faulting module kernel32.dll, version 5.2.3790.4062, stamp 462643a7, debug? 0, fault address 0x000000000000dd10.&lt;/blockquote&gt;&lt;br /&gt;
I've seen this before, actually, on our own code.&amp;nbsp; Seems sometimes developers will write an app in a 32-bit environment but not explicitly set it to load 32-bit.&amp;nbsp; This is generally ok since most .NET apps will run fine in 32-bit or 64-bit, but it seems LogParser Lizard includes a lot of freeware .dll's that are 32-bit only.&amp;nbsp; As a result, even though the main .exe loads 64-bit, it tries to then load 32-bit only .dll's.&lt;br /&gt;
&lt;br /&gt;
Fortunately this is easy to fix.&amp;nbsp; If you don't already have it installed, install the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1AEF6FCE-6E06-4B66-AFE4-9AAD3C835D3D&amp;amp;displaylang=en"&gt;Microsoft .NET 2.0 SDK&lt;/a&gt;.&amp;nbsp; In it there's a tool called "&lt;a href="http://msdn.microsoft.com/en-us/library/ms164699%28VS.80%29.aspx"&gt;corflags.exe&lt;/a&gt;" (no, there's no "e" in corflag).&amp;nbsp; This is used to modify the header of a binary to set it to be explicitly 32-bit.&lt;br /&gt;
&lt;br /&gt;
To do this, run:&lt;br /&gt;
&lt;br /&gt;
corflags.exe c:\full\path\to\logparserlizard.exe /32BIT+&lt;br /&gt;
&lt;br /&gt;
To undo it, run the same with /32BIT-&lt;br /&gt;
&lt;br /&gt;
Then it runs fine :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-2183803094107435301?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/XnS-xC1s7mc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/2183803094107435301/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=2183803094107435301" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2183803094107435301?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2183803094107435301?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/XnS-xC1s7mc/logparser-lizard-on-windows-vista-x64.html" title="LogParser Lizard on Windows Vista x64, 2003 x64, 2008 x64" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>8</thr:total><feedburner:origLink>http://blog.geekpoet.net/2009/09/logparser-lizard-on-windows-vista-x64.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMASXk_fCp7ImA9WxJTGEQ.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-6662016853414887503</id><published>2009-04-27T20:27:00.000-07:00</published><updated>2009-04-27T21:20:48.744-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-27T21:20:48.744-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><title>A Script to fix Windows Update Services clients not appearing in the WSUS console</title><content type="html">After going through a bunch of patching solutions and being somewhat dissatisfied with most, I decided to give Microsoft's Windows Update Services another go.  I hadn't used it since the 1.0 days and it was, well, rather 1.0 then.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;WSUS 3.0 has a decent feature set, the two most desirable ones being a nice reporting system and the fact it's client is built into Windows (yes yes we can go back and forth on the merits or evil-ness of this fact, but its built in and therefore one less client I need to install...)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In our lab, this worked great.  I have a setup where our load-balanced farms update and reboot several hours apart on saturdays, and our core boxes download but wait for manual updating.  It was, in fact, one of the most flawless, hands-off setups I've worked with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, this was in the lab.  In the real world, I ran into several issues.  If you google for "WSUS clients not registering" or "WSUS clients disappear" you'll see a myriad of issues, several of which I came across.  I won't post them here but the one that really irked me was this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In production we have several hundred machines, most of which all show up in the WSUS console just fine.  However, a few dozen were not appearing.  There seemed to be no real commonality between them.  They were a mix of 32-bit 2003, 64-bit 2003, and 64-bit 2008, some the "R2" editions of each.  MS's "clientdiag.exe" tool passed on all.  All the MS troubleshooting steps also confirmed access to the WSUS server.  The "WindowsUpdate.log" showed no errors beyond normal transient ones.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Turns out, after much digging, I stumbled across this registry key:&lt;/div&gt;&lt;div&gt;hklm\software\microsoft\windows\currentversion\windowsupdate\susclientid&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This, it seems, was the commonality of the several dozen machines.  Each set of machines having issues (32-bit 2003 boxes, 64-bot 2003 boxes, 2008 boxes) had the same value as each other of the same time.  Some investigation revealed these servers were clones of each other.  While the technician that built them ran NewSID or sysprep'd them, this key didn't change.  As a result, they'd check in to WSUS and conflict.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, this was only one of several issues I found.  It seems every so often I bring a new box into the WSUS system to find it not working right away.  I wrote the following script which so far addresses all of the issues I've come across.  It works on both 32-bit and 64-bit 2003 and 2008:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;div&gt;@echo off&lt;/div&gt;&lt;div&gt;::Version 9.4.26 Aaron Dodd&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;echo Stopping Windows Update Services&lt;/div&gt;&lt;div&gt;net stop wuauserv &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;echo Deleting existing WSUS registry keys&lt;/div&gt;&lt;div&gt;:: This deletes the WSUS keys managed by GPO&lt;/div&gt;&lt;div&gt;reg delete hklm\software\policies\microsoft\windows\windowsupdate /f &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;:: This deletes WSUS ID's that should be different but can be the same if windows was installed via an image&lt;/div&gt;&lt;div&gt;reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v AccountDomainSid /f &gt;NUL&lt;/div&gt;&lt;div&gt;reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v PingID /f &gt;NUL&lt;/div&gt;&lt;div&gt;reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;echo Forcing policy update to restore registry keys&lt;/div&gt;&lt;div&gt;gpupdate /target:computer /force &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;echo Deleting existing local WSUS repository&lt;/div&gt;&lt;div&gt;del /s /q c:\windows\softwaredistribution &gt;NUL&lt;/div&gt;&lt;div&gt;if exist c:\windows\syswow64 del /s /q c:\windows\syswow64\softwaredistribution &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Echo Restarting BITS&lt;/div&gt;&lt;div&gt;net stop bits &gt;NUL&lt;/div&gt;&lt;div&gt;net start bits &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Echo Starting Windows Update Services&lt;/div&gt;&lt;div&gt;net stop wuauserv &gt;NUL&lt;/div&gt;&lt;div&gt;net start wuauserv &gt;NUL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Echo Forcing re-authorization to WSUS server and detection of patches&lt;/div&gt;&lt;div&gt;wuauclt /resetauthorization /detectnow &gt;NUL&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;So far I haven't found a WSUS issue it hasn't fixed for me.&lt;br /&gt;&lt;br /&gt;Note: this script does assume you're deploying WSUS settings via GPO.  As a result, its safe to delete the entire policies...windowsupdate subkey because the GPO replaces it.  Also, deleting "softwaredistribution" is safe because wuauserv ("Windows Update" service) recreates it.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The BITS part I'm not sure is necessary, but can't hurt ;-)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, yes, I'm stopping wuauserv again before starting it.  It seems the GPO update sometimes starts it and since we just deleted the "softwaredistribution" folder, its necessary to stop/start the service again to rebuild it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you want to deploy this to many machines at once, I suggest using psexec.exe with the "-c" flag to copy this script and execute it on the target systems.  I.e. save the script as "fix_wsus.cmd":&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;for %y in (svr1,svr2,svr3) do psexec.exe \\%y -c fix_wsus.cmd&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;See "for /?" for how to specify a text file of server names if you have a lot.&lt;/div&gt;&lt;div&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/3365530156933471515-6662016853414887503?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/GUZlf81um3g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/6662016853414887503/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=6662016853414887503" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/6662016853414887503?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/6662016853414887503?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/GUZlf81um3g/script-to-fix-windows-update-services.html" title="A Script to fix Windows Update Services clients not appearing in the WSUS console" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.geekpoet.net/2009/04/script-to-fix-windows-update-services.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EARXg7eyp7ImA9WxVbFEk.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5106382995382546280</id><published>2009-03-30T11:21:00.000-07:00</published><updated>2009-03-30T13:40:44.603-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-30T13:40:44.603-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><title>Simple means of syncing IIS7 settings in a webfarm</title><content type="html">&lt;blockquote&gt;&lt;/blockquote&gt;Here's our issue:&lt;br /&gt;&lt;br /&gt;We have dozens of IIS servers in our webfarms.  Each webfarm handles specific sets of applications.  All members of each webfarm are supposed to be identical.&lt;br /&gt;&lt;br /&gt;With IIS6 this was really simple.  We would:&lt;div&gt;&lt;ol&gt;&lt;li&gt;Remove one node from the webfarm&lt;/li&gt;&lt;li&gt;Make IIS changes on one node&lt;/li&gt;&lt;li&gt;Robocopy the code to that node&lt;/li&gt;&lt;li&gt;Test against that node&lt;/li&gt;&lt;/ol&gt;If successful we would:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Bring that node back and take out a second node&lt;/li&gt;&lt;li&gt;robocopy code to that node&lt;/li&gt;&lt;li&gt;run "cscript c:\windows\system32\iiscnfg.vbs /copy /ts \\targetserver /tu domain\user /tp password" to sync the metabase to that second nodebring that node back into the webfarm&lt;/li&gt;&lt;li&gt;repeat for other nodes&lt;/li&gt;&lt;/ol&gt;This may sound like a lot of steps but I'm simply writing out what our script does for us automatically.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With IIS7, we could keep the same process if we installed the IIS6 metabase compatibility.  But, I'm not one for holding onto the past without a really good reason and while this functionality seems like a good reason, I'd rather have a more supported method that uses today's functionality.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Microsoft's management for IIS7 is . . . interesting in my opinion.  They make an excellent step towards scriptable management by putting everything in .xml files instead of binary metabase.  You can read these settings in c:\windows\system32\inetsrv\config\ApplicationHost.config.  The "interesting" part is that Microsoft for some reason decided to keep machine specific settings in this file (notably, the encryption keys).  This means if you simply copy this applicationHost.config to a sister server, you'll find IIS won't even start.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Okay, so what about scripting?  Well, Microsoft no longer includes iiscnfg.vbs (unless you include IIS6 compatability).  They have the rather nice appcmd.exe tool, but it doesn't work against remote systems.  They have the "Web Deployment Tool" but that requires re-packaging your application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I decided instead we should standardize on as little customization as possible, so Web Deployment Tool is out unless our developers will be sending us packaged deployments (which I think is a terrible idea for a production webfarm as you lose control over your server to whatever development thinks are appropriate settings).  Instead, we opted on a slight bastardization of Microsoft's official webfarm setup.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You'll want to read Microsoft's &lt;a href="http://learn.iis.net/page.aspx/264/shared-configuration/"&gt;IIS7 Shared Configuration&lt;/a&gt; guide for more details, especially for the nice screen shots.  We followed those with one exception:  We are using a local folder for the "central UNC path" instead.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This gives us two advantages over Microsoft's shared configuration recommendation:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Immunity from issues with a UNC share (credentials changing, share going down, etc)&lt;/li&gt;&lt;li&gt;The ability to make changes to just one node for testing before synchronizing, or for troubleshooting&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;It was really the second advantage that made us go this route as a pre-flight test is required prior to making a change live.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Since all of our code goes to D:\applications\[appname] which we use Robocopy to sync to all sister nodes, we just created a "D:\applications\iis_settings" folder and set that as the shared configuration path.  Now, when we robocopy our code, the IIS7 settings get immediately replicated to the sister nodes as well.  Our original process is actually a step shorter.&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/3365530156933471515-5106382995382546280?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/eLoekG503mE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5106382995382546280/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5106382995382546280" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5106382995382546280?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5106382995382546280?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/eLoekG503mE/simple-means-of-syncing-iis7-settings.html" title="Simple means of syncing IIS7 settings in a webfarm" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>6</thr:total><feedburner:origLink>http://blog.geekpoet.net/2009/03/simple-means-of-syncing-iis7-settings.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4HQn8yfCp7ImA9WxVXFko.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-2622377981145438008</id><published>2009-02-14T21:03:00.000-08:00</published><updated>2009-02-14T21:15:33.194-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-14T21:15:33.194-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="KDE" /><category scheme="http://www.blogger.com/atom/ns#" term="OSX" /><title>Importing Apple Mail into KDE's KMail</title><content type="html">There's a ton of articles on teh interwebz on how to import mail into Apple's Mail.app from KDE's KMail, but I hadn't come across anything on doing the reverse.&lt;br /&gt;&lt;br /&gt;It turns out this is insanely simple, just not obvious, especially since it wouldn't work the "official" way.&lt;br /&gt;&lt;br /&gt;KMail has some wonderful importers, including one called "Import from OS X Mail".  Being the painfully obvious choice, I fired up KMail, clicked "File / Import Messages", chose "Import from OS X Mail" and pointed it to my Mac's Library/Mail/Mailboxes folder.  I tried the root level, the mailbox folder itself, then even the subfolder "messages" which contained the actual emails.  It never actually worked.&lt;br /&gt;&lt;br /&gt;If I ever care to figure out why, I might look into it more, but the following seems to be a foolproof and quick way.&lt;br /&gt;&lt;br /&gt;In OS X's Mail.app you can right-click a mail folder and choose "Archive".  This seems mis-named to me, since generally I consider "archiving" email to mean you're sending it to an archive and removing it from the folder.  Really, this is more of a "backup".  Anyway, I digress...&lt;br /&gt;&lt;br /&gt;1. Right-click the folder you want to send to KMail&lt;br /&gt;2. Choose "Archive"&lt;br /&gt;3. Point it to a folder.  This will create a subfolder with the name of this Mailbox, which will then contain all of the email in an MBOX file.&lt;br /&gt;4. Open KMail&lt;br /&gt;5. Choose "File / Import Messages", choose "Import MBox files"&lt;br /&gt;6. Point it to the mbox file itself that Apple Mail saved.&lt;br /&gt;&lt;br /&gt;Voila!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-2622377981145438008?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/-X-O-VlEyjs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/2622377981145438008/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=2622377981145438008" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2622377981145438008?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2622377981145438008?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/-X-O-VlEyjs/importing-apple-mail-into-kdes-kmail.html" title="Importing Apple Mail into KDE's KMail" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.geekpoet.net/2009/02/importing-apple-mail-into-kdes-kmail.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQFQX8zfyp7ImA9WxRWE04.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5783486097330153898</id><published>2008-10-29T18:23:00.001-07:00</published><updated>2008-10-29T18:31:50.187-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-29T18:31:50.187-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OSX" /><title>Mac OS X alternative to SnagIt</title><content type="html">I've been spoiled by an application for &lt;a href="http://vistasucks.wordpress.com/"&gt;Windows&lt;/a&gt; called &lt;a href="http://www.techsmith.com/screen-capture.asp"&gt;SnagIt&lt;/a&gt;.  Its a really nice screen capture tool that lets you take screen grabs of portions of the screen, annotate them with arrows and boxes and text, then save or copy the result to the clipboard.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I wanted something similar for OS X.  While I knew about "ctrl + command + shift + 4" to do screen captures of specific portions of the screen (replace "4" with "3" for the whole screen), what I didn't know is that starting with 10.5, Preview actually includes all the annotation features I need.  Thanks &lt;a href="http://lifehacker.com/"&gt;LifeHacker&lt;/a&gt; for this &lt;a href="http://lifehacker.com/398463/how-to-annotate-images-in-preview"&gt;article &lt;/a&gt;(excerpt below)&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;Mac OS X Leopard only: One of the built-in Mac utilities that got the most feature additions in Leopard—albeit pretty quietly—is Preview, the PDF and image viewer. We've already covered how you can do more with Preview in Leopard, but Mac OS X Hints points out another good one: image annotation. Add arrows and notes, or circle and outline areas of an image in Preview using the Annotation menu. (In Preview's View menu choose Customize Toolbar, then drag the Annotate menu onto the toolbar.) Then, when you're editing a non-PDF image in Preview, just select your annotation, and click and drag on the image itself. Handy, and no third-party software required.&lt;/blockquote&gt;&lt;br /&gt;&lt;/div&gt;So, now to get the same features for when I need to sent an annotated screenshot, I just:&lt;div&gt;&lt;ol&gt;&lt;li&gt;use the "CTRL+COMMAND+SHIFT+4" combination to bring up the screen grab crosshairs (use can press "space" after to get a camera icon to do a grab of a whole window)&lt;/li&gt;&lt;li&gt;Select the portion I want to grab&lt;/li&gt;&lt;li&gt;Open the Preview application&lt;/li&gt;&lt;li&gt;Either do "File / New" or "COMMAND+N", which opens a new document with the contents of the clipboard&lt;/li&gt;&lt;li&gt;Annotate away!&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-5783486097330153898?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/yjYQ1UYhPus" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5783486097330153898/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5783486097330153898" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5783486097330153898?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5783486097330153898?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/yjYQ1UYhPus/mac-os-x-alternative-to-snagit.html" title="Mac OS X alternative to SnagIt" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/10/mac-os-x-alternative-to-snagit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8DQnw9eyp7ImA9WxRQFkU.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-4706093379088938224</id><published>2008-10-10T17:44:00.000-07:00</published><updated>2008-10-10T18:01:13.263-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-10T18:01:13.263-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="bash" /><title>removing duplicate files with under bash using fdupes and accounting for spaces</title><content type="html">&lt;div&gt;Basically, I've been lazy.  I've been trying to organize a file structure, been unhappy with it, copied it, tried again, been unhappy, copied . . . and ended up with about six copies of this folder each with various additions made to it at various subfolder levels that I need to account for.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;Now, I could simply do a recursive find and look for duplicate file names, but the other part of my being lazy is a lot of files in various subfolders are named simply with the very imaginative format of the date I wrote the file.  What I wanted was to compare md5 checksums to be sure they were truly identical.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;While I use Windows at work and could whip of a powershell script to handle this on Windows, I run OS X for my personal machine.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I've tinkered with bash scripting before, enough to know that what I want to do should be doable in one line with the help of the great utility &lt;a href="http://premium.caribe.net/~adrian2/fdupes.html"&gt;fdupes&lt;/a&gt;. (fdupes can be installed on OS X easily if you have &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; installed, simply call "sudo port install fdupes")&lt;/div&gt;&lt;br /&gt;I whipped up the following and was proud of myself:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;for i in $(fdupes -rf ./); do echo deleting: $i; rm $i; done&lt;/blockquote&gt;(of course the "rm" was done after making a backup ;-) )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What I noticed was this worked fine for all files except those with spaces in the name.  I apparently some files that were saved with the first sentence as the filename, which the output of this command confirmed as:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;deleting: some&lt;/div&gt;&lt;div&gt;deleting: file&lt;/div&gt;&lt;div&gt;deleting: with&lt;/div&gt;&lt;div&gt;deleting: spaces.txt&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;After some head scratching thinking about piping through awk or escaping out the spaces, I found this on a google &lt;a href="http://www.macgeekery.com/tips/cli/handling_filenames_with_spaces_in_bash"&gt;result&lt;/a&gt;:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;If you set IFS to $'\n' then it will only split on newlines, not spaces.&lt;/blockquote&gt;Could it be that simple?  YES!  My completed commands:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;IFS=$'\n'&lt;/div&gt;&lt;div&gt;for i in $(fdupes -rf ./); do echo deleting: $i; rm $i; done&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&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/3365530156933471515-4706093379088938224?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/P1Md-gOwwvc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/4706093379088938224/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=4706093379088938224" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/4706093379088938224?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/4706093379088938224?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/P1Md-gOwwvc/removing-duplicate-files-with-under.html" title="removing duplicate files with under bash using fdupes and accounting for spaces" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/10/removing-duplicate-files-with-under.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8FQ3s_fip7ImA9WxRQFUU.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5650488456892506790</id><published>2008-10-09T12:19:00.000-07:00</published><updated>2008-10-09T12:33:32.546-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-09T12:33:32.546-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><title>Manipulating remote services with Powershell 1.0</title><content type="html">I know Powershell 2.0 CTP2 includes remote support for the get/set-service cmdlet, but I cannot use beta code in production and needed a way to use Powershell to accomplish the same functions we use the Resource Kit "sc.exe" tool for now (start, stop, enable/disable).&lt;br /&gt;&lt;br /&gt;After much googling, this turned out to be insanely simple, yet hard to find.&lt;br /&gt;&lt;br /&gt;First, get the remote service using WMI:&lt;br /&gt;&lt;blockquote&gt;$Svc = Get-WmiObject -Computer $Server win32_service -filter "name='$Service'"&lt;/blockquote&gt;Second, issue the appropriate control command:&lt;br /&gt;To start a service:&lt;br /&gt;&lt;blockquote&gt;$Result = $Svc.StartService()&lt;/blockquote&gt;To stop a service:&lt;br /&gt;&lt;blockquote&gt;$Result = $Svc.StopService()&lt;/blockquote&gt;To disable a service:&lt;br /&gt;&lt;blockquote&gt;$Result = $Svc.ChangeStartMode("Disabled")&lt;/blockquote&gt;To enable a service for manual:&lt;br /&gt;&lt;blockquote&gt;$Result = $Svc.ChangeStartMode("Manual")&lt;/blockquote&gt;To enable a service for auto start:&lt;br /&gt;&lt;blockquote&gt;$Result = $Svc.ChangeStartMode("Auto")&lt;/blockquote&gt;&lt;br /&gt;Third, check if the command worked; just look for $Result.ReturnValue.  It should be "0" if it succeeded.:&lt;br /&gt;&lt;blockquote&gt;$Result.ReturnValue&lt;/blockquote&gt;&lt;br /&gt;For reference, "5" means you tried to stop an already stopped service and "10" means you tried to start and already started service.&lt;br /&gt;&lt;br /&gt;You can also check the current state by:&lt;br /&gt;&lt;blockquote&gt;$Svc.State&lt;/blockquote&gt;And the current StartMode by:&lt;br /&gt;&lt;blockquote&gt;$Svc.StartMode&lt;/blockquote&gt;&lt;br /&gt;I would also add in a step after calling "Get-WmiObject" to verify you actually connected to a service.  There is no response if the service didn't exist, but you can simply check if $Svc is null or not:&lt;br /&gt;&lt;blockquote&gt;If (!($Svc)) { #perform action }&lt;/blockquote&gt;&lt;br /&gt;If this wasn't fully helpful for you (i.e. you want to manipulate lots of services or many machines) I found the best google search term to be "powershell win32_service" from http://google.com/microsoft&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-5650488456892506790?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/dDBjBcusdsw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5650488456892506790/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5650488456892506790" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5650488456892506790?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5650488456892506790?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/dDBjBcusdsw/manipulating-remote-services-with.html" title="Manipulating remote services with Powershell 1.0" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>3</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/10/manipulating-remote-services-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QFR3o9fyp7ImA9WxRQEEs.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-2078319836729728571</id><published>2008-05-29T17:55:00.000-07:00</published><updated>2008-10-03T12:15:16.467-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-03T12:15:16.467-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dell openmanage xen" /><title>HowTo Install Dell OpenManage 5.3 on Citrix XenServer 4.1 and have it listed in a central OpenManage Management System</title><content type="html">&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;Update 10/3/2008:&lt;/span&gt; I have successfully followed these directions to install OpenManage 5.4 under XenServer 5.0.&lt;br /&gt;&lt;br /&gt;A few months ago  I &lt;a href="http://blog.geekpoet.net/2008/03/how-to-install-dell-openmanage-530-on.html"&gt;posted an article&lt;/a&gt; on how to install &lt;a href="http://www.dell.com/openmanage"&gt;Dell OpenManage&lt;/a&gt; on a &lt;a href="http://www.citrix.com/XenServer"&gt;Citrix XenServer&lt;/a&gt;.  Since then I've been wanting to  have the Xen servers appear in our central OpenManage  Management System so we can get central  alerting of hardware issues.  I've discovered a few gotcha's along the way, and figured it'd be a good idea to post one consolidated how-to for anyone interested.&lt;br /&gt;&lt;br /&gt;This article pulls heavily on vendor documentation, but let me stress that as of the posting of this how-to, neither Citrix nor Dell officially support running OpenManage on a XenServer.&lt;br /&gt;&lt;br /&gt;For reference, here are the documents I've used:&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://kb.xensource.com/entry%21default.jspa?categoryID=52&amp;amp;externalID=443&amp;amp;printable=true"&gt;Citrix's KnowledgeBase article&lt;/a&gt; on how to get IT Assistant, the client-side component also called "OpenManage Managed Node", also called "OpenManage Server Administrator", also known as "Dell OpenManage Server Administrator Managed Node".   Seriously, different names names all depending on the readme, package file, or Dell's support site.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Dell's &lt;a href="http://support.dell.com/support/edocs/software/svradmin/5.3/en/ug/html/setup.htm#wp1047723"&gt;page from the 5.3 manual on configuring SNMP&lt;/a&gt; under Linux&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;And the software you'll need is:&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Citrix XenServer 4.1&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Dell &lt;a href="http://support.us.dell.com/support/downloads/format.aspx?releaseid=R175666&amp;amp;c=us&amp;amp;l=en&amp;amp;cs=555&amp;amp;s=biz"&gt;OpenManage Management Station&lt;/a&gt; installed on a Windows server somewhere and properly configured/working, with your SNMP traps/destinations/communities configured for the IP range the XEN server is on.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Dell &lt;a href="http://support.us.dell.com/support/downloads/format.aspx?releaseid=R171069&amp;amp;c=us&amp;amp;l=en&amp;amp;cs=555&amp;amp;s=biz"&gt;OpenManage Managed Node 5.3&lt;/a&gt; for RedHat Enterprise&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;Okay, now lets begin.  I suggest doing all of these changes on a test system first.  At the end, I'd suggest consolidating all of the changed files and make a new .tar.gz file to deploy to your other servers.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:times new roman;font-size:100%;"  &gt;Step 1: Modify the OpenManage installation package&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;Remember, this isn't an officially supported solution, so if you try to run the Server Administrator Managed Node installation right away, you'll get an error that it doesn't recognize Xen's linux distribution (CentOS, fyi).&lt;br /&gt;&lt;/span&gt;&lt;ol  style="font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Copy the tar.gz file to your Xen host.  I use &lt;a href="http://winscp.net/"&gt;WinSCP &lt;/a&gt;for this.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Extract the tar.gz you downloaded to a temporary folder:&lt;br /&gt;tar -xzf OM_5.3.0_ManNode_A00.tar.gz&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Edit the file "setup.sh":&lt;br /&gt;vi setup.sh&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Change the lines 2972 and 2973 as follows:&lt;br /&gt;2972: GBL_OS_TYPE=${GBL_OS_TYPE_UKNOWN}&lt;br /&gt;2973:  GBL_OS_TYPE_STRING="UKNOWN"&lt;br /&gt;Become:&lt;br /&gt;2972: GBL_OS_TYPE=${GBL_OS_TYPE_RHEL5}&lt;br /&gt;2973:  GBL_OS_TYPE_STRING="RHEL5"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Save the file&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;font-family:times new roman;font-size:100%;"  &gt;Step 2: Aquire "lockfile"&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;I noticed originally when running the "setup.sh" script, that as it tried to start the services the inventory service would fail with an error&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;" id="downloadDetailSection" class="para"  &gt;&lt;blockquote&gt;Warning: The lockfile utility is not found in PATH or /usr/bin.&lt;br /&gt;   This utility prevents concurrent executions of setup.sh&lt;br /&gt;   which can lead to unexpected or invalid installation results.&lt;/blockquote&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;Or with:&lt;br /&gt;&lt;blockquote&gt;no lockfile in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin)&lt;br /&gt;invcol Error: Cannot find utilities on the system to execute Inventory&lt;br /&gt;Collector.&lt;br /&gt;Make sure the following utilities are in the path: tar gzip tail rm mkdir&lt;br /&gt;chmod ls basename wc lockfile stat&lt;/blockquote&gt;I figured the easiest way to get this file would be to run YUM, the CentOS repository system which Xen helpfully left in.  This, of course, had its own set of issues.  From &lt;a href="http://blog.geekpoet.net/2008/05/issue-with-dell-openmanage-53-inventory.html"&gt;my previous article on YUM under Xen&lt;/a&gt;, you may need to do the following.  I'd suggest first testing if "lockfile" exists by typing "which lockfile".  If you don't have "lockfile" installed, then proceed:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote  style="font-family:times new roman;"&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;Xen is using CentOS for their host OS, but they disable the CentOS repository and enable what appears to be a non-existent/functional Xen repository. Whenever you try to use Yum, it throws an error that the repository checksum is invalid:&lt;br /&gt;&lt;blockquote&gt;http://updates.xensource.com/XenServer/4.0.96/domain0/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum&lt;br /&gt;Trying other mirror.&lt;br /&gt;Error: failure: repodata/primary.xml.gz from xensource: [Errno 256] No more mirrors to try.&lt;/blockquote&gt;To resolve this temporarily, and only on my test system, I edited /etc/yum.repos.d/XenSource.repo and changed the following line:&lt;br /&gt;&lt;blockquote&gt;enabled=1&lt;/blockquote&gt;to:&lt;br /&gt;&lt;blockquote&gt;enabled=0&lt;/blockquote&gt;I then edited /etc/yum/repos.d/CentOS-Base.repo and changed the following line under the top "[base]" section&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span id="downloadDetailSection" class="para"&gt;&lt;blockquote&gt;enabled=0&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;to:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span id="downloadDetailSection" class="para"&gt;&lt;blockquote&gt;enabled=1&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;"yum whatprovides lockfile" now returned a bunch of results. It seems "lockfile" is part of the postfix package. To get this file I:&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;ran "yum install postfix"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;copied "/usr/bin/lockfile" to a temporary location&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;ran "yum remove postfix"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"  style="font-size:100%;"&gt;copied "lockfile" back to "/usr/bin/lockfile"&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;Now starting the services ("/opt/dell/srvadmin/omil/supportscripts/srvadmin-services.sh restart") no longer shows an error and I can see the inventory in the GUI&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:times new roman;font-size:100%;"  &gt;Step 3: Configure SNMP&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;This can actually be fairly complex depending on your SNMP setup in your environment.  I'm going to assume you're doing a simple configuration here, where you have two communities set up in your OpenManage Management System for this IP range: "MY_READ" and "MY_WRITE" configured for read and write access, respectively.  In this case, just copy in what I have below, after making a backup of the original.&lt;br /&gt;&lt;br /&gt;If you want an explanation of the options and conventions used below, try "man snmpd.conf", Google "snmpd.conf", or read Dell's &lt;a href="http://support.dell.com/support/edocs/software/svradmin/5.3/en/ug/html/setup.htm#wp1047723"&gt;page from the 5.3 manual on configuring SNMP&lt;/a&gt; under Linux.  If you get stuck, feel free to leave a comment here and I'll help you as best I can.&lt;br /&gt;&lt;/span&gt;&lt;ol  style="font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Rename the original snmpd.conf file:&lt;br /&gt;mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Copy the following into a new /etc/snmp/snmpd.conf file, changing the "MY" strings to your own:&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;blockquote  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;# Map users to community strings&lt;br /&gt;#          sec.name     source          community&lt;br /&gt;com2sec    U_ReadOnly    default        MY_READ&lt;br /&gt;com2sec    U_ReadWrite    default     MY_WRITE&lt;br /&gt;&lt;br /&gt;# Map users to groups&lt;br /&gt;#       groupName    securityModel     securityName&lt;br /&gt;group     G_ReadOnly     any         U_ReadOnly&lt;br /&gt;group     G_ReadWrite     any         U_ReadWrite&lt;br /&gt;&lt;br /&gt;# create view&lt;br /&gt;#       name           incl/excl     subtree         mask(optional)&lt;br /&gt;view    all            included      .1&lt;br /&gt;&lt;br /&gt;# grant rights to the above views&lt;br /&gt;#       group    context    sec.model sec.level prefix read   write  notif&lt;br /&gt;access  G_ReadOnly    ""  any  noauth  exact  all  none  none&lt;br /&gt;access  G_ReadWrite    ""   any   noauth   exact   all   all   none&lt;br /&gt;&lt;br /&gt;# Set trap destination&lt;br /&gt;trapsink my.openmanage.server MY_MANAGEMENT&lt;br /&gt;&lt;br /&gt;# Allow localhost access&lt;br /&gt;rocommunity MY_READ        127.0.0.1&lt;br /&gt;rwcommunity MY_WRITE    127.0.0.1&lt;br /&gt;&lt;br /&gt;# Allow remote hosts access&lt;br /&gt;rocommunity MY_READ &lt;/span&gt;&lt;span style="font-size:100%;"&gt;my.openmanage.server&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;rwcommunity MY_WRITE &lt;/span&gt;&lt;span style="font-size:100%;"&gt;my.openmanage.server&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;# Below has been left in from the default snmpd.conf file:&lt;br /&gt;syslocation Unknown (edit /etc/snmp/snmpd.conf)&lt;br /&gt;syscontact Root &lt;root@localhost&gt; (configure /etc/snmp/snmp.local.conf)&lt;/root@localhost&gt;&lt;br /&gt;&lt;br /&gt;# Added for support of bcm5820 cards.&lt;br /&gt;pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat&lt;br /&gt;&lt;br /&gt;# Allow Systems Management Data Engine SNMP to connect to snmpd using SMUX&lt;br /&gt;smuxpeer .1.3.6.1.4.1.674.10892.1&lt;br /&gt;&lt;/span&gt;                                                                  &lt;/blockquote&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;Now, restart SNMP by typing:&lt;br /&gt;service snmpd restart&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:times new roman;font-size:100%;"  &gt;Step 4: Modify IPTABLES&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;XenServer contains a firewall that needs to be modified before OpenManage can see this node.&lt;br /&gt;&lt;br /&gt;Below are my modifications to the iptables file.  You only really need the lines for UDP 161 and UDP 162.  The TCP 1311 is if you choose to install the "Web Administration Console", which I don't because it takes up 100M of RAM.&lt;br /&gt;&lt;/span&gt;&lt;ol  style="font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Make a backup copy of the current iptables file, just in case:&lt;br /&gt;cp /etc/sysconfig/iptables /etc/sysconfig/iptables.orig&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Edit the file as below, adding in the &lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;BOLD &lt;/span&gt;&lt;span style="font-size:100%;"&gt;lines in the same place.  This is important as the order of the file determines what is allowed.  If you simply append these lines to the end, traffic will be blocked:&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;blockquote  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;# Firewall configuration written by system-config-securitylevel&lt;br /&gt;# Manual customization of this file is not recommended.&lt;br /&gt;*filter&lt;br /&gt;:INPUT ACCEPT [0:0]&lt;br /&gt;:FORWARD ACCEPT [0:0]&lt;br /&gt;:OUTPUT ACCEPT [0:0]&lt;br /&gt;:RH-Firewall-1-INPUT - [0:0]&lt;br /&gt;-A INPUT -j RH-Firewall-1-INPUT&lt;br /&gt;-A FORWARD -j RH-Firewall-1-INPUT&lt;br /&gt;-A RH-Firewall-1-INPUT -i lo -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -p 50 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -p 51 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT&lt;br /&gt;&lt;b&gt;-A RH-Firewall-1-INPUT -p udp -m udp --dport 161 -j ACCEPT&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-A RH-Firewall-1-INPUT -p udp -m udp --dport 162 -j ACCEPT&lt;/b&gt;&lt;br /&gt;-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;&lt;b&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1311 -j ACCEPT&lt;/b&gt;&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 694 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;COMMIT&lt;/span&gt;                                                  &lt;/blockquote&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;Now, restart iptables by typing:&lt;br /&gt;service iptables restart&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 5: Install OpenManage&lt;/span&gt;&lt;br /&gt;Finally :)&lt;br /&gt;&lt;/span&gt;&lt;ol style="font-family: times new roman;"&gt;&lt;li&gt;Change to the directory where you extracted "setup.sh"&lt;/li&gt;&lt;li&gt;Execute the setup script:&lt;br /&gt;./setup.sh&lt;/li&gt;&lt;li&gt;You'll be prompted with a screen asking you which options to select.  I generally only install 1,3,4,5.  Option 2, "Server Administrator Web Server" will consume at least 100M of the XenServer RAM so I usually leave it off.  After you selected your options, press "i" to install&lt;/li&gt;&lt;li&gt;Follow the prompts checking for errors.  I usually take all the defaults from here&lt;/li&gt;&lt;li&gt;When prompted, go ahead and start the services.  Watch for errors&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:times new roman;"&gt;Thats it!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Now go to your OpenManage Management System console and initiate a "Discovery and Inventory" of the IP range for this XenServer.  It should show up.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;For reference, you can stop/start the OpenManage services by running:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;/opt/dell/srvadmin/omil/supportscripts/srvadmin-services.sh stop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;/opt/dell/srvadmin/omil/supportscripts/srvadmin-services.sh start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;And you can uninstall it by running:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;/opt/dell/srvadmin/omil/supportscripts/srvadmin-uninstall.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:times new roman;" &gt;Step 6 (optional): Repackage all of this as a new tar.gz&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;I did the following to ease deployment, as this is a lot of steps.&lt;/span&gt;&lt;br /&gt;&lt;ol style="font-family: times new roman;"&gt;&lt;li&gt;I copied the snmpd.conf, iptables, and lockfile to my extracted "openmanage" folder:&lt;br /&gt;cp /etc/snmp/snmpd.conf /root/openmanage/&lt;br /&gt;cp /etc/sysconfig/iptables /root/openmanage/&lt;br /&gt;cp /usr/bin/lockfile /root/openmanage/&lt;/li&gt;&lt;li&gt;I wrote a wrapper for setup.sh to make the above changes for me prior to running setup.sh.  The contents of the wrapper script are below.&lt;/li&gt;&lt;li&gt;After creating the wrapper script, I made sure it was executable:&lt;br /&gt;chmod +x /root/openmanage/setup_wrapper.sh&lt;/li&gt;&lt;li&gt;I made a new tarball of all of this:&lt;br /&gt;cd /root&lt;br /&gt;tar -czf modified_om_5.3_mannode.tar.gz openmanage/&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:times new roman;"&gt;Pay attention, there's a space between "gz" and "openmanage/"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;My wrapper script:&lt;/span&gt;&lt;br /&gt;&lt;blockquote style="font-family: times new roman;"&gt;#!/bin/sh&lt;br /&gt;# version 8.5.20 Aaron Dodd&lt;br /&gt;# back up existing config files&lt;br /&gt;cp /etc/sysconfig/iptables /etc/sysconfig/iptables.orig&lt;br /&gt;cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig&lt;br /&gt;&lt;br /&gt;#copy in new config files&lt;br /&gt;cp iptables /etc/sysconfig/iptables&lt;br /&gt;cp snmpd.conf /etc/snmp/snmpd.conf&lt;br /&gt;&lt;br /&gt;cp lockfile /usr/bin/lockfile&lt;br /&gt;&lt;br /&gt;# restart affected daemons&lt;br /&gt;service snmpd restart&lt;br /&gt;service iptables restart&lt;br /&gt;&lt;br /&gt;./setup.sh&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-2078319836729728571?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/WajKKN3Erp8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/2078319836729728571/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=2078319836729728571" title="15 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2078319836729728571?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2078319836729728571?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/WajKKN3Erp8/howto-install-dell-openmanage-53-on.html" title="HowTo Install Dell OpenManage 5.3 on Citrix XenServer 4.1 and have it listed in a central OpenManage Management System" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>15</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/05/howto-install-dell-openmanage-53-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUDSXgzfyp7ImA9WxdTEkg.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-3778472368095474343</id><published>2008-05-08T07:10:00.000-07:00</published><updated>2008-05-08T07:34:38.687-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-08T07:34:38.687-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="thunderbird" /><title>Importing / Exporting filters in Thunderbird 2.0, copying filters between folders</title><content type="html">Thunderbird 2.0 has an annoying limitation of only being able to specify rules for folder roots and cannot apply these rules to other sets of folders.  That would be less annoying if Thunderbird offered a way to move or copy rules between folder roots.&lt;br /&gt;&lt;br /&gt;For example, I use IMAP to speak to our corporate Exchange server.  I have a set of rules configured there.  I also have "Local Folders" which contains my "Archive" folder, where I put all the IMAP emails I want to keep.&lt;br /&gt;&lt;br /&gt;Sometimes I add a filter to the IMAP folders that I want to then process retroactively against my archive (i.e. to add a certain tag to be picked up in the Save Searches folders I have).  Using just the Thunderbird interface I'd have to manually recreate this rule.&lt;br /&gt;&lt;br /&gt;There are a few extensions on addons.mozilla.org for exporting and importing rules. I haven't had any success with these.  I get errors that the folder doesn't exist or such.&lt;br /&gt;&lt;br /&gt;You can fairly easily copy rules between folders by editing the underlying rules file.  To do this:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Find out your root folder locations.  For each of the sets of folders you want to copy rules between, right-click the folder in Thunderbird and choose "Properties".&lt;/li&gt;&lt;li&gt;Remember the location listed under "Local Directory".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Close Thunderbird.  If Thunderbird is open, any changes you make to the rules file appear to get overwritten as soon as you open the Filters window again&lt;/li&gt;&lt;li&gt;Navigate to the locations from step 2.&lt;/li&gt;&lt;li&gt;In each is a file called "msgFilterRules.dat".  This is a plain text file.  Make a backup copy, then open the original in your favorite text editor&lt;/li&gt;&lt;li&gt;There is no explicit delimeters between rules, but for me a rule seems to always start with the line "name=" and end with the line "condition=".  Just copy that block from one msgFilterRules.dat" file to the other.&lt;/li&gt;&lt;li&gt;Launch Thunderbird and you should now see that rule in the Filters window.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-3778472368095474343?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/GMC0GqNZ3HM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/3778472368095474343/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=3778472368095474343" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/3778472368095474343?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/3778472368095474343?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/GMC0GqNZ3HM/importing-exporting-filters-in.html" title="Importing / Exporting filters in Thunderbird 2.0, copying filters between folders" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/05/importing-exporting-filters-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YFSHk8cCp7ImA9WxdTEkg.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-2875080197015835544</id><published>2008-05-08T06:51:00.000-07:00</published><updated>2008-05-08T06:58:39.778-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-08T06:58:39.778-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Dell" /><category scheme="http://www.blogger.com/atom/ns#" term="XEN" /><title>Issue with Dell OpenManage 5.3 inventory under Xen Server 4.1</title><content type="html">I wrote in &lt;a href="http://blog.geekpoet.net/2008/03/how-to-install-dell-openmanage-530-on.html"&gt;this article how to install Dell OpenManage 5.3 on a Xen 4.1 Host&lt;/a&gt;.  However, &lt;span id="downloadDetailSection" class="para"&gt;I noticed that when logging into the test systems' GUI that I wasn't seeing an inventory of hardware. Performing the installation again, I noticed a few errors I didn't see originally.&lt;br /&gt;&lt;br /&gt;When first running setup.sh, there is a brief display of the following error:&lt;br /&gt;&lt;blockquote&gt;Warning: The lockfile utility is not found in PATH or /usr/bin.&lt;br /&gt;         This utility prevents concurrent executions of setup.sh&lt;br /&gt;         which can lead to unexpected or invalid installation results.&lt;/blockquote&gt;This appeared again when starting the services&lt;br /&gt;&lt;br /&gt;To resolve this, I decided to install lockfile via YUM.  The problem is, YUM seems broken by default in 4.1.&lt;br /&gt;&lt;br /&gt;Xen is using CentOS for their host OS, but they disable the CentOS repository and enable what appears to be a non-existent/functional Xen repository. Whenever you try to use Yum, it throws an error that the repository checksum is invalid:&lt;br /&gt;&lt;blockquote&gt;http://updates.xensource.com/XenServer/4.0.96/domain0/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum&lt;br /&gt;Trying other mirror.&lt;br /&gt;Error: failure: repodata/primary.xml.gz from xensource: [Errno 256] No more mirrors to try.&lt;/blockquote&gt;To resolve this temporarily, and only on my test system, I edited /etc/yum.repos.d/XenSource.repo and changed the following line:&lt;br /&gt;&lt;blockquote&gt;enabled=1&lt;/blockquote&gt;to:&lt;br /&gt;&lt;blockquote&gt;enabled=0&lt;/blockquote&gt;I then edited /etc/yum/repos.d/CentOS-Base.repo and changed the following line under the top "[base]" section&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span id="downloadDetailSection" class="para"&gt;&lt;blockquote&gt;enabled=0&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id="downloadDetailSection" class="para"&gt;to:&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span id="downloadDetailSection" class="para"&gt;&lt;blockquote&gt;enabled=1&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span id="downloadDetailSection" class="para"&gt;"yum whatprovides lockfile" now returned a bunch of results. It seems "lockfile" is part of the postfix package. To get this file I:&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;ran "yum install postfix"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;copied "/usr/bin/lockfile" to a temporary location&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;ran "yum remove postfix"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;copied "lockfile" back to "/usr/bin/lockfile"&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;Now starting the services ("/opt/dell/srvadmin/omil/supportscripts/srvadmin-services.sh restart") no longer shows an error and I can see the inventory in the GUI&lt;br /&gt;&lt;br /&gt;To avoid this cumbersome process on our other Xen hosts I make a new tar.gz of the extracted and modified OpenManage installation which included this file, which I make sure to copy to /usr/bin prior to running "setup.sh" above.&lt;br /&gt;&lt;span id="downloadDetailSection" class="para"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-2875080197015835544?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/daHFVCjDzHY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/2875080197015835544/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=2875080197015835544" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2875080197015835544?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2875080197015835544?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/daHFVCjDzHY/issue-with-dell-openmanage-53-inventory.html" title="Issue with Dell OpenManage 5.3 inventory under Xen Server 4.1" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/05/issue-with-dell-openmanage-53-inventory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQ385fSp7ImA9WxdTEUo.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-2483671806362684350</id><published>2008-05-07T08:19:00.001-07:00</published><updated>2008-05-07T08:29:12.125-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-07T08:29:12.125-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="exchange" /><category scheme="http://www.blogger.com/atom/ns#" term="thunderbird" /><title>Using LDAP in Thunderbird 2.0 to query Microsoft Exchange for addresses</title><content type="html">I've recently switched from Outlook to Thunderbird/Lightening for my email and calendaring needs.  I use IMAP to talk to our Exchange server, but was missing being able to querying the global address book.&lt;br /&gt;&lt;br /&gt;Thunderbird supports LDAP, but it took some digging around to get this to work right.  Here's what I did.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In Thunderbird, I clicked "Go" and choose "Address Book"&lt;/li&gt;&lt;li&gt;I clicked "New" and "LDAP Directory"&lt;/li&gt;&lt;li&gt;In the "Directory Server Properties" window that appears, on the "General" tab I gave the "Name" a meaningful value (in this case, our Exchange server).&lt;/li&gt;&lt;li&gt;In the "Hostname" field I entered the FQDN of our Exchange server (i.e. mail.mycompany.com)&lt;/li&gt;&lt;li&gt;For Base DN, since I know we're not doing anything fancy I entered in "DC=mycompany,DC=com" since I know that's our AD root DN.&lt;/li&gt;&lt;li&gt;For "Port Number" enter 3268.  I was a little confused at first as I could telnet to our Exchange server over both LDAP and LDAP/SSL ports.  But, Thunderbird couldn't seem to query them.  But after googling Exchange and LDAP, apparently Exchange doesn't use the standard LDAP ports, it uses 3268.&lt;/li&gt;&lt;li&gt;For "Bind DN" simply enter your username in domain\username format.&lt;/li&gt;&lt;/ol&gt;Seems obvious in retrospect but I figured I'd post it in case anyone else needed help.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-2483671806362684350?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/pAIC750Xua0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/2483671806362684350/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=2483671806362684350" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2483671806362684350?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2483671806362684350?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/pAIC750Xua0/using-ldap-in-thunderbird-20-to-query.html" title="Using LDAP in Thunderbird 2.0 to query Microsoft Exchange for addresses" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/05/using-ldap-in-thunderbird-20-to-query.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cBRHs4cCp7ImA9WxdTEE8.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5931018379269403099</id><published>2008-05-04T16:50:00.000-07:00</published><updated>2008-05-05T13:57:35.538-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-05T13:57:35.538-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><category scheme="http://www.blogger.com/atom/ns#" term="XEN" /><title>Manual "P2V" migration of a Windows server into a XEN VM instance</title><content type="html">Xen doesn't officially offer a P2V solution for migrating existing physical Windows instances into XEN VMs.  Their answer is a link to two vendors that offer XEN support for their P2V products.  Both companies, however, charge a few hundred bucks per-migration, which makes it a bit expensive for the one-off migrations here and there (in both vendors' defense, the P2V functions aren't the main purpose of their products).  I've used the following steps to perform migrations of Dell-based Windows 2003 Server instances into XEN virtual machines simply using NTBackup, without having to purchase any "P2V" tools/licenses.&lt;br /&gt;&lt;br /&gt;These steps basically mimic how one can recover a Windows server onto new hardware after a failure, with some extra precautions taken to avoid interrupting the existing physical instance until it's ready to be replaced.&lt;br /&gt;&lt;br /&gt;The steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;From the original server, I perform an NTBACKUP-based backup of the system state and the harddrives to a file share on the network.&lt;/li&gt;&lt;li&gt;On the XEN host I provision a new machine of the same OS type and SP level as the physical machine to be moved.  For example: if I'm moving a multi-CPU Windows 2003 Standard 32-bit server with Service Pack2, I provision a VM with Windows 2003 Standard 32-bit with Service Pack2 and multiple VCPUs.  (Note: the HAL of the VM must match the original server's, so if you're migrating a single, non-hyperthreaded CPU machine, provision the VM with only one VCPU).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;This new VM must have the same drive layouts as the original server.  I.e. if I have the OS on "C:" and the applications on "D:" and the CDROM mapped to "Z:" on the original server, I do the same on this VM.  The only exception can be to create additional VM disk images that don't exist on the original server as long as they're mounted on a drive letters not used on the original server.  I create "E:" for temporary space for below as I want the .BKF file local for the restore.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;On the new VM I copy the following files off the C drive to the "E:" local disk:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;c:\boot.ini&lt;/li&gt;&lt;li&gt;c:\windows\repair&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;I copy in the .BKF file created in step 1 to the new VM's "E:" disk as I want to disconnect the NIC before restoring.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In the XEN console, I switch the VM's NIC to a non-used network so that it won't be able to talk to our network or domain controllers.  This is to avoid interrupting the physical machine's functionality until I'm done, as the VM will take its SID, domain credentials, and possibly IP address.&lt;/li&gt;&lt;li&gt;On the new VM I run NTBACKUP and choose "Restore".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Under "Tools / Options" I choose the "Restore" tab and click the radio button "Always replace the file on my computer", as otherwise NTBACKUP will skip any existing newer files.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I then restore the local harddrives and system state from the backup&lt;/li&gt;&lt;li&gt;BEFORE REBOOTING I copy the boot.ini and windows\repair folders back in from the copies made in step 4 above&lt;/li&gt;&lt;li&gt;I run the Xen Tools installer to install XEN's PV, NIC, and SCSI drivers&lt;/li&gt;&lt;li&gt;I reboot.  Sometimes at this point I get a blue-screen saying helpfully "An error has occurred."  If this happens I reboot into safe mode and:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Go into the device manager&lt;/li&gt;&lt;li&gt;Delete the existing SCSI card (do this even if it shows up as a Citrix XEN SCSI card)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Install Xen Tools again&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Reboot&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;When the machine comes up, I verify all the settings match the live server's.  If they do, I then:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Turn off the physical instance&lt;/li&gt;&lt;li&gt;In the Xen console, switch the NIC to be on the proper network, allowing it to talk to our domain controller&lt;/li&gt;&lt;li&gt;I assign it the same IP address as the physical server, if appropriate&lt;/li&gt;&lt;li&gt;I reboot and allow it to log into the domain&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;br /&gt;If there are any failures logging into the domain, its most likely because the physical computer reset its security channel between the time the backup was made and the time the VM replaced the phyiscal server.  This can usually be fixed by typing the following commands, or demoting the machine to a workgroup server and then re-joining it to the domain:&lt;ol&gt;&lt;ol&gt;&lt;li&gt;&lt;pre class="code"&gt;NLTEST /SC_RESET:&lt;var&gt;&lt;domainname&gt;&lt;/domainname&gt;&lt;/var&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;pre class="code"&gt;netdom reset &lt;var&gt;Destination computer&lt;/var&gt; /domain:&lt;var&gt;domain_name&lt;/var&gt; usero:&lt;var&gt;admin_user&lt;/var&gt; /passwordo:&lt;var&gt;admin_user_password&lt;/var&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;Note: these commands require the Windows Support Tools to have been installed.  You can find them on the Windows install CD.&lt;br /&gt;&lt;br /&gt;There have been a few instances where I've wanted to clone a physical machine but not actually replace it with the VM.  This has been mostly in cases where I wasn't100% sure how the physical machine is set up or functions (inheriting old applications) but need to start the migration process.  The modifications to this procedure below allow me to have the new VM running in tandem with the old physical so that testing can be done to verify functionality.&lt;br /&gt;&lt;br /&gt;To keep the physical running in tandem with the VM, before starting the process above, place a copy of &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb897418.aspx"&gt;NewSid&lt;/a&gt; from Microsoft on the VM.  Then, instead of step 13 above, do the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;While the VM is still off the network, demote it from a domain member to a workgroup machine&lt;/li&gt;&lt;li&gt;Reboot&lt;/li&gt;&lt;li&gt;Run NewSid and as part of running it, change the name to something unique&lt;/li&gt;&lt;li&gt;Reboot&lt;/li&gt;&lt;li&gt;Give the VM a new IP address, different than the physical&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now you can bring the server onto the network and join it to the domain under the new name, IP, and SID&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-5931018379269403099?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/zSC_dvKAW3c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5931018379269403099/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5931018379269403099" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5931018379269403099?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5931018379269403099?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/zSC_dvKAW3c/manual-p2v-migration-of-windows-server.html" title="Manual &quot;P2V&quot; migration of a Windows server into a XEN VM instance" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>7</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/05/manual-p2v-migration-of-windows-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AHRX85eyp7ImA9WxZaFUU.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-8715460902976395013</id><published>2008-04-30T13:52:00.000-07:00</published><updated>2008-04-30T14:08:54.123-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-30T14:08:54.123-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><title>Powershell script to report on all IIS servers in our domain</title><content type="html">There are many scripts out there to query IIS via WMI or ADSI and enumerate the settings and report on them.  However, we back up all of our server's code to a central share every night, which includes grabbing the IIS metabase.xml file, so I decided to avoid yet another call to the remote servers (and having to deal with possible authentication / connection / etc issues) and instead use Powershell's ability to read XML files to parse each of these and report on the servers' IIS settings.&lt;br /&gt;&lt;br /&gt;This is actually two separate scripts.  One is "ReportMetabase.ps1" which does the actual parsing of the metabase file.  You call it as "ReportMetabase.ps1 [full\path\to\metabase.xml] [report.csv]" and it will generate a CSV of all websites, virtual folders, and their associated application pools, webroots, application names, serverbindings, and metabase IDs.&lt;br /&gt;&lt;br /&gt;The second script is "ProcessMetabases.ps1" which will, based on the settings of its .config file, step through a directory tree and for each match of "metabase.xml", invoke "ReportMetabase.ps1" and capture its results into a compiled CSV of all systems.&lt;br /&gt;&lt;br /&gt;One thing I added into this after making it is the ability to specify a list of server renames.  Apparently, when you rename a server, the IIS Metabase keeps the "ServerComment" field with the old server's name.  I discovered this after suddenly seeing servers I thought we decommissioned years ago show up on the report...&lt;br /&gt;&lt;br /&gt;While I run this against a copy of all of our code, you can easily run this against a local server's metabase.xml even while IIS is running.  It simply reads in the metabase.xml, doesn't actually open or lock the file, and does not even attempt to open it for writing.&lt;br /&gt;&lt;br /&gt;Pre-Requisites:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Windows 2003 (not tested on 2000 or 2008) and IIS 6.0&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Powershell 1.0&lt;/li&gt;&lt;li&gt;A copy of all metabase.xml files in your environment and access to read them, OR, run ReportMetabase.ps1 against the local metabase of a machine.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;What this script does:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;ProcesMetabases.ps1 reads in its .config file to determine what directory tree to traverse, what to use as a temporary folder, and where to save the file report.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;ProcesMetabase.ps1 then traverses a directory tree and calls ReportMetabase.ps1 with the location to the Metabase.xml and a temp.csv file name.  Each iteration it adds the contents of temp.csv to a compiled list to be saved after all Metabase.xml files have been read&lt;/li&gt;&lt;li&gt;ReportMetabase.ps1 reads in its .config file to determine a list of server renames to apply, and a list of virtual directories or websites to exclude from the report&lt;/li&gt;&lt;li&gt;ReportMetabase.ps1 then imports the specified Metabase.xml and loops through each Website and VirtualDirectory key, saving each value to a custom object&lt;/li&gt;&lt;li&gt;The custom object is then exported to the specified csv file.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Script Files:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://aarondodd.com/gpdn/scripts/ReportMetabase_8.4.21.zip"&gt;ReportMetabase_8.4.21.zip (contains ProcessMetabases.ps1 and ReportMetabase.ps1)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the zipfile&lt;/li&gt;&lt;li&gt;Extract it to a target folder&lt;/li&gt;&lt;li&gt;Modify both .config files to contain the proper values&lt;/li&gt;&lt;li&gt;Either call ReportMetabase.ps1 against a local server, or ProcessMetabases.ps1 against a directory tree of metabase.xml files.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;For reference, here are the scripts:&lt;br /&gt;&lt;br /&gt;ProcessMetabases.ps1:&lt;br /&gt;&lt;pre&gt;$Version="v8.4.21 Aaron Dodd"&lt;br /&gt;$Description="Wrapper for ReportMetabases.ps1"&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Settings / Variables&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;If (Test-Path "ProcessMetabases.config") {&lt;br /&gt;   $cfg=[xml](get-content "ProcessMetabases.config")&lt;br /&gt;} Else {&lt;br /&gt;   Write-Host "!! ERROR !! - Config file not found"&lt;br /&gt;   Write-Host "A file with the same name as this script, ending in .config, must exist in the same directory as this script."&lt;br /&gt;   exit&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$StateManagementRoot=$cfg.configuration.StateManagementRoot.name&lt;br /&gt;$FinalReport=$cfg.configuration.FinalReport.name&lt;br /&gt;$TempDir=$cfg.configuration.TempFolder.name&lt;br /&gt;$TempReport=$TempDir + "\temp.csv"&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Process metabase files&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;$Metabases=Get-ChildItem -path $StateManagementRoot -recurse -include Metabase.xml | select fullname&lt;br /&gt;&lt;br /&gt;ForEach ($Metabase in $Metabases) {&lt;br /&gt; ./ReportMetabase.ps1 $Metabase.FullName $TempReport&lt;br /&gt; $TempCsv += Import-Csv $TempReport&lt;br /&gt;}&lt;br /&gt;$TempCsv | Export-Csv $FinalReport -notype&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;ReportMetabases.ps1:&lt;br /&gt;&lt;pre&gt;$Version="v8.4.21 Aaron Dodd"&lt;br /&gt;$Description="Processes a metabase.xml file and reports all websites and various important settings"&lt;br /&gt;$Usage="ReportOnMetabase.ps1 [path\to\metabase.xml] [report.csv]"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#==============================================================================&lt;br /&gt;# Verify we received arguments&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;If ($args.count -lt 2) {&lt;br /&gt;   Write-Host $Version&lt;br /&gt;   Write-Host $Description&lt;br /&gt;   Write-Host $Usage&lt;br /&gt;   exit&lt;br /&gt;}&lt;br /&gt;#==============================================================================&lt;br /&gt;# Settings / Variables&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Import config file&lt;br /&gt;If (Test-Path "ReportMetabase.config") {&lt;br /&gt;   $cfg=[xml](get-content "ReportMetabase.config")&lt;br /&gt;} Else {&lt;br /&gt;   Write-Host "!! ERROR !! - Config file not found"&lt;br /&gt;   Write-Host "A file with the same name as this script, ending in .config, must exist in the same directory as this script."&lt;br /&gt;   exit&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Object to hold the contents of the metabase file&lt;br /&gt;$mb=[xml](get-content $args[0])&lt;br /&gt;&lt;br /&gt;# Report to save&lt;br /&gt;$ReportFile=$args[1]&lt;br /&gt;&lt;br /&gt;# Hash table of metabase location # and ServerComment values from IIsWebServer keys&lt;br /&gt;# Used to map virtual directories and other settings to their root websites by name&lt;br /&gt;$LocationCommentMapping = @{}&lt;br /&gt;$LocationBindingMapping = @{}&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Array of virtual directories to ignore&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# These would be the 5th element of the metabase "location" key, i.e.:&lt;br /&gt;# /LM/W3SVC/#/ROOT/VirtualDirectory&lt;br /&gt;$VirtualDirectoryIgnoreList = New-Object System.Collections.ArrayList&lt;br /&gt;ForEach ($key in $cfg.configuration.Exclusions.VirtualDirectory.add) {&lt;br /&gt;   $VirtualDirectoryIgnoreList.add($key.name) &gt; $Null&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Array of websites to ignore&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# This would be the value of the metabase "ServerComment" key&lt;br /&gt;$WebSiteIgnoreList = New-Object System.Collections.ArrayList&lt;br /&gt;ForEach ($key in $cfg.configuration.Exclusions.WebSite.add) {&lt;br /&gt;   $WebSiteIgnoreList.add($key.name) &gt; $Null&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Array of metabase IDs to ingore&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# These would be the 3rd element of the metabase "location" key, i.e.:&lt;br /&gt;# /LM/W3SVC/3&lt;br /&gt;$LocationIndexIgnoreList = New-Object System.Collections.ArrayList&lt;br /&gt;ForEach ($key in $cfg.configuration.Exclusions.LocationIndex.add) {&lt;br /&gt;   $LocationIndexIgnoreList.add($key.name) &gt; $Null&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Hash table of server renames&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# We take the setting from the metabase for what the servername is. However,&lt;br /&gt;# if a server is renamed, the metabase retains the original name. This is hash&lt;br /&gt;# table of known renames, to replace&lt;br /&gt;$ServerRenames = @{}&lt;br /&gt;ForEach ($key in $cfg.configuration.ServerRenames.add) {&lt;br /&gt;   $ServerRenames.add($key.key,$key.value)&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Disconnected Recordset to hold all our info before writing to disk&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;$adVarChar = 200        # field type to be set to variant in recordset&lt;br /&gt;$adFldIsNullable = 32   # to make recordset field nullable&lt;br /&gt;$MaxCharacters = 255    # max size of field&lt;br /&gt;&lt;br /&gt;$MBRecordSet = New-Object -com "ADOR.RecordSet"&lt;br /&gt;$MBRecordSet.Fields.Append("Location", $adVarChar, $MaxCharacters, $adFldIsNullable)&lt;br /&gt;$MBRecordSet.Fields.Append("Name", $adVarChar, $MaxCharacters, $adFldIsNullable)&lt;br /&gt;$MBRecordSet.Fields.Append("Path", $adVarChar, $MaxCharacters, $adFldIsNullable)&lt;br /&gt;$MBRecordSet.Fields.Append("ServerBindings", $adVarChar, $MaxCharacters, $adFldIsNullable)&lt;br /&gt;$MBRecordSet.Fields.Append("AppPoolId", $adVarChar, $MaxCharacters, $adFldIsNullable)&lt;br /&gt;$MBRecordSet.Fields.Append("AppRoot", $adVarChar, $MaxCharacters, $adFldIsNullable)&lt;br /&gt;$MBRecordSet.Open()&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Objects containing the metabase settings we'll query&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;$WebSites = $mb.configuration.MBProperty.IIsWebServer | select ServerComment,ServerBindings,AppPoolId,Location&lt;br /&gt;$WebVDirs = $mb.configuration.MBProperty.IIsWebVirtualDir | select AppFriendlyName,Path,AppPoolId,Location,AppRoot&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#==============================================================================&lt;br /&gt;# Process Metabase&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Determine ServerName&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;If (!$mb.configuration.MBProperty.IIsWebService.ServerComment) {&lt;br /&gt;   $WebServerName = "[UNKNOWN]"&lt;br /&gt;} Else {&lt;br /&gt;   $WebServerName = $mb.configuration.MBProperty.IIsWebService.ServerComment&lt;br /&gt;}&lt;br /&gt;If ($ServerRenames.ContainsKey($WebServerName)) {&lt;br /&gt;   $WebServerName = $ServerRenames.Get_Item($WebServerName)&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Process the "IIsWebServer" key first to enumerate all root websites&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;ForEach ($Site in $WebSites) {&lt;br /&gt;   # Site.Location is /LM/W3SVC/number.  We want the "number"&lt;br /&gt;   $ThisLocationIndex = $Site.Location.Split('/')[3]&lt;br /&gt;&lt;br /&gt;   # Proceed if this isn't a website location index to ignore&lt;br /&gt;   If ($LocationIndexIgnoreList -notcontains $ThisLocationIndex) {&lt;br /&gt;       # Populate the recordset&lt;br /&gt;       $MBRecordSet.AddNew()&lt;br /&gt;       $MBRecordSet.Fields.Item("Location") = $Site.Location&lt;br /&gt;       $MBRecordSet.Fields.Item("Name") = $Site.ServerComment&lt;br /&gt;       $MBRecordSet.Fields.Item("AppRoot") = $Site.ServerComment&lt;br /&gt;      &lt;br /&gt;       # Multiple bindings are separated by linebreaks and tabs. Lets convert to semi-colon&lt;br /&gt;       $TempBindings = [regex]::Replace($Site.ServerBindings,"`n",";");&lt;br /&gt;       $TempBindings = [regex]::Replace($TempBindings,"`t","");&lt;br /&gt;      $MBRecordSet.Fields.Item("ServerBindings") = $TempBindings&lt;br /&gt;      &lt;br /&gt;       # Populate hash tables&lt;br /&gt;       $LocationBindingMapping.Add($ThisLocationIndex,$TempBindings)&lt;br /&gt;       $LocationCommentMapping.Add($ThisLocationIndex,$Site.ServerComment)&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Process the "IIsWebVirtualDir" key to enumerate all VDirs and root settings&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;ForEach ($Site in $WebVDirs) {&lt;br /&gt;   # Site.Location is /LM/W3SVC/number/AppRoot/AppName&lt;br /&gt;   $ThisLocationIndex = $Site.Location.Split('/')[3]&lt;br /&gt;   $ThisAppName = $Site.Location.Split('/')[5]&lt;br /&gt;  &lt;br /&gt;      &lt;br /&gt;   # Proceed if this isn't a website location index to ignore&lt;br /&gt;   If ($LocationIndexIgnoreList -notcontains $ThisLocationIndex) {&lt;br /&gt;       # If there is no AppPoolId, it's the DefaultAppPool&lt;br /&gt;       If (!$Site.AppPoolId) {&lt;br /&gt;           $ThisAppPool="DefaultAppPool"&lt;br /&gt;       } Else {&lt;br /&gt;           $ThisAppPool=$Site.AppPoolId&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       If (!$ThisAppName) {&lt;br /&gt;           # Process /LM/W3SVC/#/ROOT sites, but not /ROOT/Vdir&lt;br /&gt;           # This updates existing root site properties from Bindings above&lt;br /&gt;           $MBRecordSet.MoveFirst();&lt;br /&gt;           do {&lt;br /&gt;               $MbLocationIndex = $MBRecordSet.Fields.Item("Location").Value.Split('/')[3]&lt;br /&gt;               If ($MbLocationIndex -eq $ThisLocationIndex) {&lt;br /&gt;                   $MBRecordSet.Fields.Item("Path") = $Site.Path&lt;br /&gt;                   $MBRecordSet.Fields.Item("AppPoolId") = $ThisAppPool&lt;br /&gt;              &lt;br /&gt;                   $MBRecordSet.Update()&lt;br /&gt;               }&lt;br /&gt;               $MBRecordSet.MoveNext()&lt;br /&gt;           } until ($MBRecordSet.EOF)&lt;br /&gt;      &lt;br /&gt;       } Else {&lt;br /&gt;           # Process /LM/W3SVC/#/ROOT/Vdir sites&lt;br /&gt;           $ThisAppRoot = $LocationCommentMapping.Get_Item($ThisLocationIndex)&lt;br /&gt;           $ThisBinding = $LocationBindingMapping.Get_Item($ThisLocationIndex)&lt;br /&gt;&lt;br /&gt;           $MBRecordSet.AddNew()&lt;br /&gt;           $MBRecordSet.Fields.Item("Location") = $Site.Location&lt;br /&gt;           $MBRecordSet.Fields.Item("Path") = $Site.Path&lt;br /&gt;           $MBRecordSet.Fields.Item("Name") = $ThisAppName&lt;br /&gt;           $MBRecordSet.Fields.Item("AppRoot") = $ThisAppRoot&lt;br /&gt;           $MBRecordSet.Fields.Item("ServerBindings") = $ThisBinding&lt;br /&gt;           $MBRecordSet.Fields.Item("AppPoolId") = $ThisAppPool&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;#==============================================================================&lt;br /&gt;# Save the report&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Start the CSV file, adding the headers&lt;br /&gt;"IIS Website Name,Application Name,Server,Path,AppPoolId,ServerBindings,MetabaseLocationID" | out-file $ReportFile&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# Loop through recordset and output results to CSV&lt;br /&gt;$MBRecordSet.Sort = "AppRoot ASC"&lt;br /&gt;$MBRecordSet.MoveFirst();&lt;br /&gt;do {&lt;br /&gt;   $ThisLocationIndex = $MBRecordSet.Fields.Item("Location").Value.Split('/')[3]&lt;br /&gt;   $ThisWebSite = $MBRecordSet.Fields.Item("AppRoot").Value&lt;br /&gt;   $ThisVirtualDir = $MBRecordSet.Fields.Item("Name").Value&lt;br /&gt;&lt;br /&gt;   # Make sure we're not outputting items listed in the IgnoreList arrays&lt;br /&gt;   If (&lt;br /&gt;       $WebSiteIgnoreList -notcontains $ThisWebSite -and&lt;br /&gt;       $VirtualDirectoryIgnoreList -notcontains $ThisVirtualDir -and&lt;br /&gt;       $LocationIndexIgnoreList -notcontains $ThisLocationIndex&lt;br /&gt;      ) {&lt;br /&gt;&lt;br /&gt;       $Output = $MBRecordSet.Fields.Item("AppRoot").Value.ToLower() + ","&lt;br /&gt;       $Output += $MBRecordSet.Fields.Item("Name").Value.ToLower() + ","&lt;br /&gt;       $Output += $WebServerName.ToLower() + ","&lt;br /&gt;       $Output += $MBRecordSet.Fields.Item("Path").Value.ToLower() + ","&lt;br /&gt;       $Output += $MBRecordSet.Fields.Item("AppPoolId").Value.ToLower() + ","&lt;br /&gt;       $Output += $MBRecordSet.Fields.Item("ServerBindings").Value.ToLower() + ","&lt;br /&gt;       $Output += $MBRecordSet.Fields.Item("Location").Value.ToLower()&lt;br /&gt;       $Output | out-file -append $ReportFile&lt;br /&gt;   }&lt;br /&gt;   $MBRecordSet.MoveNext()&lt;br /&gt;} until ($MBRecordSet.EOF)&lt;br /&gt;#==============================================================================&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-8715460902976395013?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/Q-5pvu_7ZVw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/8715460902976395013/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=8715460902976395013" title="10 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/8715460902976395013?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/8715460902976395013?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/Q-5pvu_7ZVw/powershell-script-to-report-on-all-iis.html" title="Powershell script to report on all IIS servers in our domain" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>10</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/04/powershell-script-to-report-on-all-iis.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIEQ3k_cSp7ImA9WxZaFUU.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5305275815453144453</id><published>2008-04-30T13:23:00.000-07:00</published><updated>2008-04-30T13:48:22.749-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-30T13:48:22.749-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><title>Powershell script to monitor MSMQ queues</title><content type="html">Part of one of the products I support communicates with other products via Microsoft Message Queues (MSMQ).  While we can monitor all of the various servers' CPU, memory, disk, network, etc for performance issues, one of the best determining factors is to see if a queue has suddenly grown.  Since all queues should be either near zero or at a steady amount of messages depending on the time of day, any queue that shows an upward trend or sudden spike usually means there is an issue somewhere.&lt;br /&gt;&lt;br /&gt;I usually run this at peak times of the day with a polling interval of ten seconds, whereas our monitoring system polls once every few minutes.  This allows me to quickly see trends that may need attention.  I also run it after performing maintenance just to verify the traffic patterns.&lt;br /&gt;&lt;br /&gt;This script will not only query and display the most populated queues, but will also keep a count of the previous seven iterations to show an upward or downward trend.  See below:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_76CELcLHjko/SBjZFaD7E3I/AAAAAAAAAGo/EqawUWUar1g/s1600-h/queryqueues.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_76CELcLHjko/SBjZFaD7E3I/AAAAAAAAAGo/EqawUWUar1g/s400/queryqueues.jpg" alt="" id="BLOGGER_PHOTO_ID_5195140857090216818" border="0" /&gt;&lt;/a&gt;(Queue names were changed post-screenshot, sorry for the sloppiness)&lt;br /&gt;&lt;br /&gt;Pre-Requisites:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Windows 2003 (not tested on 2000 or 2008)&lt;/li&gt;&lt;li&gt;Powershell 1.0&lt;/li&gt;&lt;li&gt;Rights to perform perfmon queries against the MSMQ server&lt;/li&gt;&lt;li&gt;Rights to enumerate the messages in all of the MSMQ queues&lt;br /&gt;&lt;/li&gt;&lt;li&gt;This has only been tested against "Private Queues"&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;What this script does:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It reads in its .config files to determine the MSMQ server to contact, the important queues (if any) to flag, the top number of queues to poll, and the polling interval&lt;/li&gt;&lt;li&gt;It then connects to the target server and queries for the largest X queues (defined in the config file)&lt;/li&gt;&lt;li&gt;It steps through each queue and if its name matches an "important queue" it flags it with an asterisk&lt;/li&gt;&lt;li&gt;Assigns the queue's name and count to a custom object&lt;/li&gt;&lt;li&gt;Prints the custom object in table form&lt;/li&gt;&lt;li&gt;On the next iteration, it sets the previous values to the custom object's "PriorN" column, keeping the previous 7 total.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Script files:&lt;a href="http://aarondodd.com/gpdn/scripts/QueryQueues_8.4.28.zip"&gt;&lt;br /&gt;&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://aarondodd.com/gpdn/scripts/QueryQueues_8.4.28.zip"&gt;QueryQueues_8.4.28.zip&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the code&lt;/li&gt;&lt;li&gt;Extract it to a target folder&lt;/li&gt;&lt;li&gt;Edit the .config file to set the proper values&lt;/li&gt;&lt;li&gt;Execute it&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;For reference, here is the script code:&lt;br /&gt;&lt;pre&gt;$Version="v8.4.28 Aaron Dodd"&lt;br /&gt;$Description="Query MSMQ server for top X queues"&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Settings / Variables&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;$cfg=[xml](get-content QueryQueues.config)&lt;br /&gt;&lt;br /&gt;$Computer = $cfg.configuration.QueueServer.name&lt;br /&gt;$ImportantQueues = $cfg.configuration.ImportantQueues&lt;br /&gt;$MaxQueues = $cfg.configuration.MaxQueues.value&lt;br /&gt;$PollInterval = $cfg.configuration.PollInterval.value&lt;br /&gt;&lt;br /&gt;# Hashes to store the values (queuename, messagescount)&lt;br /&gt;$Current=@{}  &lt;br /&gt;$Previous1=@{}&lt;br /&gt;$Previous2=@{}&lt;br /&gt;$Previous3=@{}&lt;br /&gt;$Previous4=@{}&lt;br /&gt;$Previous5=@{}&lt;br /&gt;$Previous6=@{}&lt;br /&gt;$Previous7=@{}&lt;br /&gt;&lt;br /&gt;# Make an array of important queues&lt;br /&gt;$ImpQueues=@()&lt;br /&gt;ForEach ($Queue in $ImportantQueues.Queue) {&lt;br /&gt;  $ImpQueues+=$Queue.name&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Continously poll the MSMQ server, report results&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;For () {&lt;br /&gt;&lt;br /&gt;  clear&lt;br /&gt;&lt;br /&gt;  $Queues= Get-WmiObject Win32_PerfFormattedData_MSMQ_MSMQQueue -computer $computer | Sort-Object -property "MessagesinQueue" -descending | Select-Object -first $MaxQueues&lt;br /&gt;&lt;br /&gt;  # Update the historical queue hashes, clear the current hash&lt;br /&gt;  $Previous7=$Previous6&lt;br /&gt;  $Previous6=$Previous5&lt;br /&gt;  $Previous5=$Previous4&lt;br /&gt;  $Previous4=$Previous3&lt;br /&gt;  $Previous3=$Previous2&lt;br /&gt;  $Previous2=$Previous1&lt;br /&gt;  $Previous1=$Current&lt;br /&gt;  $Current=@{}  &lt;br /&gt;&lt;br /&gt;  # Repeat for "important queues"&lt;br /&gt;&lt;br /&gt;  #Collection to store the object of values to report on&lt;br /&gt;  $ColReport = @()&lt;br /&gt;&lt;br /&gt;  ForEach ($Queue in $Queues) {&lt;br /&gt;      $QueueName = $Queue.Name.Split('\')[2]&lt;br /&gt;      # If the $QueueName is an "important" queue, we'll prepend it with "* " for readability&lt;br /&gt;      If ($ImpQueues -contains $QueueName) {$QueueName = "* " + $QueueName}&lt;br /&gt;      $Current.Add($QueueName,$Queue.MessagesInQueue)&lt;br /&gt;  }&lt;br /&gt;  ForEach ($Entry in $Current.GetEnumerator()) {&lt;br /&gt;      $Name = $Entry.Name&lt;br /&gt;      $Curr = $Entry.Value&lt;br /&gt;    &lt;br /&gt;      If ($Previous1.ContainsKey($Name)) {&lt;br /&gt;          $Prior1 = $Previous1.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior1 = "-"&lt;br /&gt;      }&lt;br /&gt;      If ($Previous2.ContainsKey($Name)) {&lt;br /&gt;          $Prior2 = $Previous2.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior2 = "-"&lt;br /&gt;      }&lt;br /&gt;      If ($Previous3.ContainsKey($Name)) {&lt;br /&gt;          $Prior3 = $Previous3.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior3 = "-"&lt;br /&gt;      }&lt;br /&gt;      If ($Previous4.ContainsKey($Name)) {&lt;br /&gt;          $Prior4 = $Previous4.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior4 = "-"&lt;br /&gt;      }&lt;br /&gt;      If ($Previous5.ContainsKey($Name)) {&lt;br /&gt;          $Prior5 = $Previous5.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior5 = "-"&lt;br /&gt;      }&lt;br /&gt;      If ($Previous6.ContainsKey($Name)) {&lt;br /&gt;          $Prior6 = $Previous6.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior6 = "-"&lt;br /&gt;      }&lt;br /&gt;      If ($Previous7.ContainsKey($Name)) {&lt;br /&gt;          $Prior7 = $Previous7.Get_Item($Name)&lt;br /&gt;      } Else {&lt;br /&gt;          $Prior7 = "-"&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      $ObjReport = New-Object System.Object&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Queue -value $Name&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Curr -value $Curr&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior1 -value $Prior1&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior2 -value $Prior2&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior3 -value $Prior3&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior4 -value $Prior4&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior5 -value $Prior5&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior6 -value $Prior6&lt;br /&gt;      $ObjReport | Add-Member -type NoteProperty -name Prior7 -value $Prior7&lt;br /&gt;      $ColReport += $ObjReport&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $ColReport | Sort-Object Curr -descending | Format-Table -auto&lt;br /&gt;&lt;br /&gt;  $timestamp = Get-Date&lt;br /&gt;  Write-Host Last Updated: $timestamp&lt;br /&gt;  Start-Sleep -seconds $PollInterval&lt;br /&gt;}&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Future enhancements:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If someone can help me out with how, I'd like to have the "important queues" show up with a different background color instead of simply renaming it to prepend an asterisk&lt;/li&gt;&lt;li&gt;I'd love to incorporate the ability to press a key to force a new loop instead of having to wait the polling interval, for times when I want to quickly see queue changes&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-5305275815453144453?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/j8wevVx9gwU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5305275815453144453/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5305275815453144453" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5305275815453144453?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5305275815453144453?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/j8wevVx9gwU/powershell-script-to-monitor-msmq.html" title="Powershell script to monitor MSMQ queues" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_76CELcLHjko/SBjZFaD7E3I/AAAAAAAAAGo/EqawUWUar1g/s72-c/queryqueues.jpg" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/04/powershell-script-to-monitor-msmq.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEGSHY4fip7ImA9WxZaFUU.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-3233386300610515702</id><published>2008-04-30T12:40:00.000-07:00</published><updated>2008-04-30T13:17:09.836-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-30T13:17:09.836-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><title>Powershell script to report on all scheduled tasks in our domain</title><content type="html">One of the annoying things about Windows management is that you cannot centrally manage scheduled tasks across your environment.  You're either spending a lot of money on a third party system to do this for you, or your trying to script this.&lt;br /&gt;&lt;br /&gt;I'll skip going into a rant about what I think of most of the available task management products out there (yes, package management and gui automation are nice, but I really just want to manage the native Windows Scheduled Tasks, not replace it).  I had previously played with WINAT and command line scripts to utilize AT.EXE.  Neither were sufficient as they both worked with the old-style NT4 tasks, which meant you couldn't see them via Scheduled Tasks nor could you run them under their own identities.&lt;br /&gt;&lt;br /&gt;Windows 2000 introduced a method to query Scheduled Task info via WMI but there was no way to actually set the information.&lt;br /&gt;&lt;br /&gt;By pure accident I found "schtasks.exe", the exact utility I'd been looking for.  With SCHTASKS.EXE you can query, create, delete, start, stop, etc any scheduled task on any server you have administrative rights, both locally and remotely.  Whats even nicer is SCHTASKS.EXE supports exporting query results in .CSV format.&lt;br /&gt;&lt;br /&gt;Below is a script that will take a list of servers and generate a master CSV of all of their tasks info.&lt;br /&gt;&lt;br /&gt;For more information on using SCHTASKS.EXE, just run "SCHTASKS.EXE /?" from the command line.&lt;br /&gt;&lt;br /&gt;Pre-Requisites:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Windows 2003 (not tested on 2000 or 2008)&lt;/li&gt;&lt;li&gt;Powershell 1.0&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;What this script does:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Reads in values from a .config file for where to find a CSV file of server names, where to save the report, and what to use as its temp folder&lt;/li&gt;&lt;li&gt;Loops through the specified list of servers and calls SCHTASKS against it with the option to save a verbose .csv file of all task info&lt;/li&gt;&lt;li&gt;After each loop interation, reads the temporary .csv file into a CSV object of all prior iterations&lt;/li&gt;&lt;li&gt;After all servers are queried, it saves the final compiled report&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Script files:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://aarondodd.com/gpdn/scripts/QueryScheduledTasks_8.4.28.zip"&gt;QueryScheduledTasks_8.4.28.zip&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the code&lt;/li&gt;&lt;li&gt;Extract it wherever you like&lt;/li&gt;&lt;li&gt;Modify the .config file to update the values&lt;/li&gt;&lt;li&gt;Modify the servers.csv file to have the names of the servers to query&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;For reference, here is the script code:&lt;br /&gt;&lt;pre&gt;$Version="v8.4.28 Aaron Dodd"&lt;br /&gt;$Description="Generate CSV of scheduled tasks in the environment"&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Settings / Variables&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;If (Test-Path "QueryScheduledTasks.config") {&lt;br /&gt;$cfg=[xml](get-content "QueryScheduledTasks.config")&lt;br /&gt;} Else {&lt;br /&gt;Write-Host "!! ERROR !! - Config file not found"&lt;br /&gt;Write-Host "A file with the same name as this script, ending in .config, must exist in the same directory as this script."&lt;br /&gt;exit&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$ServerList = Import-Csv $cfg.configuration.ServerList.name&lt;br /&gt;$FinalReport=$cfg.configuration.FinalReport.name&lt;br /&gt;$TempDir=$cfg.configuration.TempFolder.name&lt;br /&gt;$TempReport=$TempDir + "\temp.csv"&lt;br /&gt;$ErrorActionPreference=$cfg.configuration.ErrorAction.value&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;# Process tasks&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;ForEach ($Server in $ServerList) {&lt;br /&gt;schtasks /QUERY /S $Server.Name /FO CSV /V &gt; $TempReport&lt;br /&gt;$TempCsv += Import-Csv $TempReport&lt;br /&gt;}&lt;br /&gt;Remove-Item $TempReport&lt;br /&gt;$TempCsv | Export-Csv $FinalReport -notype&lt;br /&gt;#------------------------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-3233386300610515702?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/ALnMivO-AvI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/3233386300610515702/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=3233386300610515702" title="21 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/3233386300610515702?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/3233386300610515702?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/ALnMivO-AvI/powershell-script-to-report-on-all.html" title="Powershell script to report on all scheduled tasks in our domain" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>21</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/04/powershell-script-to-report-on-all.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EASHw9fip7ImA9WxZUGUk.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-1444618928445503506</id><published>2008-04-11T12:58:00.001-07:00</published><updated>2008-04-11T13:27:29.266-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-11T13:27:29.266-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><title>CMD Script to automate subversion backups</title><content type="html">This is nothing fancy, just a .cmd script to back up my production Subversion repository on a nightly basis.  There are some good ones via Google results but none that really fit my needs (too complex or too simple).&lt;br /&gt;&lt;br /&gt;Pre-Requisites:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Windows 2003 (not tested on 2000 or 2008)&lt;/li&gt;&lt;li&gt;Subversion installed locally (tools and repository) with the \bin folder in the path&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;What this script does:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If I call it with "FULL" it will:&lt;br /&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;delete all previous subversion dumps&lt;/li&gt;&lt;li&gt;create a new dump, using deltas, named "FULL_REV-#_YYYY-MM-DD.svndump" where # is the current revision number&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;If I call it with "INC" it will:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;create a new dump incremental from the previous revision number, named "INC_REV-#_YYYY-MM-DD.svndump"&lt;/li&gt;&lt;/ol&gt;My future enhancements will be:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Store the revision number of the last successful dump, and then perform the next incremental off that instead of assuming just N-1 (in case previous night's job failed)&lt;/li&gt;&lt;li&gt;Utilize the "ERR_FLAG" to send errors to our monitoring system.&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;Script Files:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can download the script here: &lt;a href="http://aarondodd.com/gpdn/scripts/svn_dump_8.4.11.rar"&gt;svn_dump_8.4.11.rar&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the code&lt;/li&gt;&lt;li&gt;Extract it anywhere you want to run it&lt;/li&gt;&lt;li&gt;Modify the file to replace the values of "RepoPath" and "DumpPath" with the proper locations for your environment&lt;/li&gt;&lt;li&gt;Execute either as "svn_dump INC" or "svn_dump FULL" (see above for what each does).&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;For reference, here's the script code:&lt;br /&gt;&lt;pre&gt;@ECHO OFF&lt;br /&gt;SETLOCAL&lt;br /&gt;SET VERSION=v8.4.11 Aaron Dodd&lt;br /&gt;SET USAGE=svn_dump.cmd [FULL -or- INC]&lt;br /&gt;&lt;br /&gt;:: Settings&lt;br /&gt;::===========================================================================&lt;br /&gt;&lt;br /&gt;SET RepoPath=D:\state_management\repository&lt;br /&gt;SET DumpPath=D:\state_management\repository_dumps&lt;br /&gt;&lt;br /&gt;:: Date/Time formatting&lt;br /&gt;::---------------------&lt;br /&gt;FOR /F "Tokens=2" %%I in ( " %date% " ) Do Set StrDate=%%I&lt;br /&gt;FOR /F "Tokens=1 delims=/ " %%M in ( " %StrDate% " ) Do Set Month=%%M&lt;br /&gt;FOR /F "Tokens=2 delims=/ " %%D in ( " %StrDate% " ) Do Set Day=%%D&lt;br /&gt;FOR /F "Tokens=3 delims=/ " %%L in ( " %StrDate% " ) Do Set Year=%%L&lt;br /&gt;FOR /F "Tokens=1 delims=. " %%I in ( " %time% " ) Do Set StrTime=%%I&lt;br /&gt;FOR /F "Tokens=1 delims=: " %%H in ( " %StrTime% " ) Do Set Hour=%%H&lt;br /&gt;FOR /F "Tokens=2 delims=: " %%M in ( " %StrTime% " ) Do Set Minute=%%M&lt;br /&gt;FOR /F "Tokens=3 delims=: " %%S in ( " %StrTime% " ) Do Set Second=%%S&lt;br /&gt;&lt;br /&gt;:: Process Arguments&lt;br /&gt;::------------------&lt;br /&gt;IF '%1' == '' GOTO USAGE&lt;br /&gt;&lt;br /&gt;IF "%1" EQU "FULL" SET DumpType=FULL&lt;br /&gt;IF "%1" EQU "full" SET DumpType=FULL&lt;br /&gt;IF "%1" EQU "INC" SET DumpType=INC&lt;br /&gt;IF "%1" EQU "inc" SET DumpType=INC&lt;br /&gt;&lt;br /&gt;IF '%DumpType%' == '' GOTO USAGE&lt;br /&gt;&lt;br /&gt;:: Verify Dependencies&lt;br /&gt;IF NOT EXIST "%RepoPath%" CALL :ERROR_PATH REPOSITORY&lt;br /&gt;IF NOT EXIST "%DumpPath%" CALL :ERROR_PATH DUMP&lt;br /&gt;&lt;br /&gt;SVNADMIN 2&gt; NUL&lt;br /&gt;IF %ErrorLevel% EQU 9009 CALL :ERROR_DEP SVNADMIN&lt;br /&gt;&lt;br /&gt;SVNLOOK 2&gt; NUL&lt;br /&gt;IF %ErrorLevel% EQU 9009 CALL :ERROR_DEP SVNLOOK&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;:: MAIN&lt;br /&gt;::===========================================================================&lt;br /&gt;::Determine latest subversion revision number&lt;br /&gt;::-------------------------------------------&lt;br /&gt;FOR /F %%Y IN ('SVNLOOK youngest "%RepoPath%"') DO SET RepoVer=%%Y&lt;br /&gt;SET /A RepoPriorVer=%RepoVer% - 1 &gt;NUL&lt;br /&gt;&lt;br /&gt;SET DumpFile=%DumpPath%\%DumpType%_REV-%RepoVer%_%Year%-%Month%-%Day%.svndump&lt;br /&gt;&lt;br /&gt;:: Clean up old svn dumps&lt;br /&gt;::-----------------------&lt;br /&gt;IF "%DumpType%" EQU "FULL" DEL /Q "%DumpPath%\*.svndump" &gt;NUL&lt;br /&gt;&lt;br /&gt;:: Perform backup&lt;br /&gt;::---------------&lt;br /&gt;IF "%DumpType%" EQU "FULL" SVNADMIN dump "%RepoPath%" --deltas &gt; %DumpFile%&lt;br /&gt;IF "%DumpType%" EQU "INC" SVNADMIN dump "%RepoPath%" -r %RepoPriorVer%:%RepoVer% --incremental &gt; %DumpFile%&lt;br /&gt;&lt;br /&gt;GOTO END&lt;br /&gt;&lt;br /&gt;:: Subroutines&lt;br /&gt;::===========================================================================&lt;br /&gt;:USAGE&lt;br /&gt;ECHO %VERSION%&lt;br /&gt;ECHO %USAGE%&lt;br /&gt;ECHO Edit this script to change where the repository path is, and where to save the dump&lt;br /&gt;GOTO END&lt;br /&gt;&lt;br /&gt;:ERROR_DEP&lt;br /&gt;ECHO !!ERROR!! - Dependency not found&lt;br /&gt;IF "%1" EQU "SVNADMIN" ECHO svnadmin.exe cannot be found.&lt;br /&gt;IF "%1" EQU "SVNLOOK" ECHO svnlook.exe cannot be found.&lt;br /&gt;ECHO Verify Subversion is installed and the \bin folder is in the system-wide PATH environment variable.&lt;br /&gt;SET ERR_FLAG=1&lt;br /&gt;GOTO END&lt;br /&gt;&lt;br /&gt;:ERROR_PATH&lt;br /&gt;ECHO !!ERROR!!&lt;br /&gt;IF "%1" EQU "REPOSITORY" ECHO Cannot find %RepoPath%&lt;br /&gt;IF "%1" EQU "DUMP" ECHO Cannot find %DumpPath%&lt;br /&gt;SET ERR_FLAG=1&lt;br /&gt;GOTO END&lt;br /&gt;&lt;br /&gt;:END&lt;br /&gt;&lt;br /&gt;ENDLOCAL&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-1444618928445503506?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/8-64o_M0AmM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/1444618928445503506/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=1444618928445503506" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/1444618928445503506?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/1444618928445503506?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/8-64o_M0AmM/cmd-script-to-automate-subversion.html" title="CMD Script to automate subversion backups" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/04/cmd-script-to-automate-subversion.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UMQ3w5fSp7ImA9WxZUGEo.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5956627192239045668</id><published>2008-04-10T13:04:00.000-07:00</published><updated>2008-04-10T19:01:22.225-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-10T19:01:22.225-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="DNS" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><title>Quick and dirty way to mass update Windows 2003 DNS entries</title><content type="html">I recently came across an issue where I wanted to add in a few hundred DNS entries into our Windows 2003 DNS server.  I wanted to script this, as I have no intention of do a mass update manually and I want to re-use this in the future.&lt;br /&gt;&lt;br /&gt;Most of the Google results I find say the easiest methods are to either convert the DNS zone to "standard primary" from "active directory integrated" and then manually editing the resulting text file created, or to use a script by Dean Wells called "&lt;a href="http://www.reskit.net/DNS/dnsdump.cm_"&gt;dnsdump.cmd&lt;/a&gt;"&lt;br /&gt;&lt;br /&gt;The problem with converting a domain to standard is, aside from being a convoluted hack, I'm updating our core AD dns zone, which obviously cannot be changed to standard without causing issues.&lt;br /&gt;&lt;br /&gt;The problem with "dnsdump.cmd" is it requires being run from the DNS server itself and is more focused on migrating DNS information than simple updates like this.&lt;br /&gt;&lt;br /&gt;I found VBScript examples using WMI, but in true VBScript fashion, while it works it takes 20 lines of script to do one line's worth of work.&lt;br /&gt;&lt;br /&gt;Reading through the source code of dnsdump.cmd, I realized it was calling "dnscmd.exe", which is one of the Windows Server support tools.  After installing the support tools (from "SUPPORT\TOOLS" on my Windows Server 2003 CD-ROM) I had this very nice utility.  You can get its syntax by just running it from the command line.  Below is a solution to my problem that only requires a text file and one call to dnscmd.exe to complete (well, I guess technically many calls, as this is a "for" loop, but you know what I mean ;-) )&lt;br /&gt;&lt;br /&gt;My solution:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a text file that only contains two space-separated values: the server name and the IP address.  For this example its called "addresses.txt".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Call dnscmd as follows:&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;blockquote&gt;for /f "tokens=1,2" %a in (addresses.txt) do dnscmd.exe dnsserver.mydomain.com /RecordAdd mydomain.com %a A %b&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Simple and sweet :)&lt;br /&gt;&lt;br /&gt;Note: you need to be an admin of "dnsserver.mydomain.com" as specified above.  Also, for PTR records, you need to change "A" to "PTR".  Just look at the output of "dnscmd.exe" by itself for help.  Also, "dnscmd.exe /EnumZones" is useful for getting the exact spelling to use for the "mydomain.com" portion above.&lt;br /&gt;&lt;br /&gt;Update: to answer a question &lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="on down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;img src="img/gl.link.gif" alt="Link" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;posed to me: "tokens=1,2" tells the "for" operator to return the first and second values of the delimited line in "addresses.txt".  By default, spaces are a delimiter, so if the text file contains "server1.mydomain.com 1.2.3.4" then %a is "server1.mydomain.com" and %b is "1.2.3.4".  You can actually use any delimiter (like a comma) and then specify such as:&lt;br /&gt;&lt;blockquote&gt;for /f "tokens=1,2 delims=," %a ....&lt;br /&gt;&lt;/blockquote&gt;Type "for /?" from a command prompt for more details.&lt;br /&gt;&lt;br /&gt;Update2: A nice article on dnscmd.exe is here: &lt;a href="http://www.informit.com/articles/article.aspx?p=19413&amp;amp;seqNum=3"&gt;Scripting DNS&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-5956627192239045668?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/HytzZWvvLZQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5956627192239045668/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5956627192239045668" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5956627192239045668?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5956627192239045668?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/HytzZWvvLZQ/quick-and-dirty-way-to-mass-update.html" title="Quick and dirty way to mass update Windows 2003 DNS entries" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/04/quick-and-dirty-way-to-mass-update.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UBQXs4fCp7ImA9WxdTEkg.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-6890271157763046266</id><published>2008-03-13T09:04:00.000-07:00</published><updated>2008-05-08T07:00:50.534-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-08T07:00:50.534-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Dell" /><category scheme="http://www.blogger.com/atom/ns#" term="XEN" /><title>How to install Dell OpenManage 5.3.0 on a XEN host</title><content type="html">We're beginning to deploy XenServer at work as our virtualization platform.  One thing that detracted from Xen during our comparison with VMWare was that VMWare and Dell worked together to get OpenManage supported on ESX.&lt;br /&gt;&lt;br /&gt;As of the moment, Xen doesn't officially support running OpenManage on Xen, although they will shortly offer official support.&lt;br /&gt;&lt;br /&gt;To get OpenManage working now, albeit in an unsupported fashion, I was helpfully sent the following KB article from XEN (which somehow I didn't see when searching their forums).  My only changes to the guide are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I used &lt;span id="downloadDetailSection" class="para"&gt;&lt;a href="http://support.us.dell.com/support/downloads/download.aspx?c=us&amp;amp;l=en&amp;amp;s=gen&amp;amp;releaseid=R171069&amp;amp;formatcnt=2&amp;amp;libid=0&amp;amp;fileid=233111"&gt;OM_5.3.0_ManNode_A00.tar.gz&lt;/a&gt; instead of 5.2.0&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;I used the XenServer 4.1 beta&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;The line numbers in "setup.sh" for OpenManage 5.3.0 that needs to be changed are 2972 and 2973&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;It is not necessary under the 4.1 beta (and probably higher) to run the "yum install" command as a newer version of the referenced .rpm file is already installed&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;EDIT 2008-05-08:&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;Some steps may need to be taken after install to resolve OM being unable to poll for inventory.  See &lt;a href="http://blog.geekpoet.net/2008/05/issue-with-dell-openmanage-53-inventory.html"&gt;this article for details&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="downloadDetailSection" class="para"&gt;For production systems I've been skipping the installation of setup.sh's item #2, "Server Administrator Web Server".  The web GUI seems to take an additional 100-120M of memory when installed.  Leaving this out only increases the Xen host footprint by a few megs.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;span id="downloadDetailSection" class="para"&gt;Dell OpenManage 5.3.0 can be downloaded from &lt;a href="http://support.us.dell.com/support/downloads/download.aspx?c=us&amp;amp;l=en&amp;amp;s=gen&amp;amp;releaseid=R171069&amp;amp;formatcnt=2&amp;amp;libid=0&amp;amp;fileid=233111"&gt;here&lt;/a&gt;.&lt;br /&gt;Xen's original article can be found &lt;a href="http://kb.xensource.com/entry%21default.jspa?categoryID=52&amp;amp;externalID=443&amp;amp;printable=true"&gt;here&lt;/a&gt;.  A copy/paste of it is below:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span&gt;Using Dell OpenManage on a XenServer Host&lt;/span&gt;&lt;br /&gt;Author:      &lt;a href="http://kb.xensource.com/accountView.jspa?userID=2"&gt;Christoph Berlin&lt;/a&gt;,  Created on: Nov 13, 2007 12:13 PM&lt;br /&gt;&lt;hr size="1" width="100%"&gt;      &lt;h2&gt;Summary&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;Dell OpenManage is a management software suitethat allows you to monitor and manage physical Dell servers. Thissoftware package is available for RedHat Enterprise Linux 4.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;TheXenServer Host runs Xen on a bare-bones CentOS Linux operating system,which is very similar to RedHat Enterprise Linux 4. It should thereforebe feasible to install OpenManage on a XenServer Host and manage it aswith any other Linux server.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This document shows you how to install Dell OpenManage on a XenServer Host.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Using OpenManage on a XenServer Host is an &lt;i&gt;unsupported configuration&lt;/i&gt;. Dell &lt;i&gt;does not support&lt;/i&gt; installing the Dell OpenManage management software on CentOS. XenSource &lt;i&gt;does not support&lt;/i&gt; installing any additional packagaes on the XenServer Host.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Procedure&lt;br /&gt;&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Download the &lt;a href="http://support.dell.com/support/downloads/download.aspx?c=us&amp;amp;l=en&amp;amp;s=gen&amp;amp;releaseid=R146387&amp;amp;SystemID=PWE_1950&amp;amp;servicetag=&amp;amp;os=RHEL5&amp;amp;osl=en&amp;amp;deviceid=2331&amp;amp;devlib=0&amp;amp;typecnt=0&amp;amp;vercnt=1&amp;amp;catid=-1&amp;amp;impid=-1&amp;amp;formatcnt=2&amp;amp;libid=36&amp;amp;fileid=203175"&gt;Dell OpenManage Server Administrator Managed Node&lt;/a&gt; software package for RedHat Enterprise Linux 5. You will find a selection of packages on the Dell support homepage.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Copy the tar.gz file to your XenServer Host.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Extract the tar.gz file by using the command&lt;br /&gt;&lt;b&gt;# tar -xzf &lt;i&gt;yourfilename&lt;/i&gt;&lt;/b&gt;&lt;b&gt;.tar.gz&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Normally this setup script would fail because the CentOS operating system is not identical RedHat Enterprise Linux 4, but you can edit the script so that it will run on CentOS as well, as follows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First, change the permissions of the file:&lt;br /&gt;&lt;b&gt;# chmod +w setup.sh&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Then, edit the file:&lt;b&gt;&lt;br /&gt;#  vi setup.sh&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Then, go to line 2976 and change the lines&lt;br /&gt;# Set default values for return variables.&lt;br /&gt;GBL_OS_TYPE=${GBL_OS_TYPE_UKNOWN}&lt;br /&gt;GBL_OS_TYPE_STRING="UKNOWN"&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;# Set default values for return variables.&lt;br /&gt;GBL_OS_TYPE=${GBL_OS_TYPE_RHEL5}&lt;br /&gt;GBL_OS_TYPE_STRING="RHEL5"&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Save changes and close the file.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/li&gt;&lt;li&gt;Install the package compat-libstdc++-296-2.96-138.i386.rpm on the XenServer Host:&lt;br /&gt;&lt;b&gt;# yum install compat-libstdc++-296-2.96-138.i386.rpm&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Start the Dell OpenManage installation by using  the command:&lt;br /&gt;&lt;b&gt;# ./setup.sh&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Follow the instructions on the screen and finish the installation.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;After installation finishes successfully, you have to change your firewall settings to allow communication through the ports that OpenManage uses, as follows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Edit the firewall file:&lt;br /&gt;&lt;b&gt;# vi /etc/sysconfig/iptables&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Add the following lines:&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1311 -j ACCEPT&lt;i&gt;&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Save and close the file.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/li&gt;&lt;li&gt;Restart the firewall service:&lt;b&gt;&lt;br /&gt;# service iptables restart&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Now should be able to connect to the Dell OpenManage web interface of your server. Point your browser to &lt;b&gt;&lt;i&gt;&lt;a href="https://yourserver:1311/"&gt;https://yourserver:1311/&lt;/a&gt; &lt;/i&gt;&lt;/b&gt;and login with your root user and password.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Tested with: OM_5.2.0_ManNode_A00.tar.gz&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;span id="downloadDetailSection" class="para"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-6890271157763046266?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/b9-CVmqGjKQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/6890271157763046266/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=6890271157763046266" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/6890271157763046266?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/6890271157763046266?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/b9-CVmqGjKQ/how-to-install-dell-openmanage-530-on.html" title="How to install Dell OpenManage 5.3.0 on a XEN host" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>5</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/03/how-to-install-dell-openmanage-530-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUENQ3g7fip7ImA9WxZWE0g.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-5077747835390010743</id><published>2008-03-12T13:21:00.000-07:00</published><updated>2008-03-12T13:28:12.606-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-12T13:28:12.606-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><title>Powershell method for testing for NULL</title><content type="html">I guess this is obvious, but I was looking for means of evaluating whether or not a variable was null by trying:&lt;br /&gt;&lt;blockquote&gt;If ($Varable -eq NUL) {some action}&lt;/blockquote&gt;Which of course caused an error.  VBScript has the IsNull(value) function, but there I could find no results googling for a similar one in PowerShell.&lt;br /&gt;&lt;br /&gt;It turns out, this is much simpler than I was making it out to be:&lt;br /&gt;&lt;br /&gt;To see if a variable is null, simply check:&lt;br /&gt;&lt;blockquote&gt;If (!$Variable) {some action}&lt;/blockquote&gt;Conversely, to verify if the variable has any value:&lt;br /&gt;&lt;blockquote&gt;If ($Variable) {some action}&lt;/blockquote&gt;&lt;br /&gt;*sigh* sometimes the simple answers take the longest to find ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-5077747835390010743?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/H_UZNv7QURo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/5077747835390010743/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=5077747835390010743" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5077747835390010743?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/5077747835390010743?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/H_UZNv7QURo/powershell-method-for-testing-for-null.html" title="Powershell method for testing for NULL" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>8</thr:total><feedburner:origLink>http://blog.geekpoet.net/2008/03/powershell-method-for-testing-for-null.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQBRXs4cCp7ImA9WB9VGUs.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-4093965085831523448</id><published>2007-11-30T11:28:00.000-08:00</published><updated>2007-12-06T11:12:34.538-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-12-06T11:12:34.538-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><title>Powershell equivalent of "Right()"</title><content type="html">In VBScript, there is the the Right() function used to return the right-most X characters of a string.&lt;br /&gt;&lt;br /&gt;After googling, I couldn't find a clear example of doing this in Powershell.  Microsoft has a page on &lt;a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/convert/default.mspx"&gt;VBscript equivalents in Powershell&lt;/a&gt;, but their &lt;a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/convert/right.mspx"&gt;Right()&lt;/a&gt; page didn't give exactly what I wanted.&lt;br /&gt;&lt;br /&gt;My delimma:&lt;br /&gt;I have a Powershell script performing a nightly commit of our production servers' code shares to an SVN repository.  One of the scripts calls "svn status", which returns the status of all files in the working folder as compared to the repository:&lt;br /&gt;&lt;blockquote&gt;!______D:\Path\to\some\file&lt;/blockquote&gt;Where the first 6 characters are status codes, there's 1 space, then the file path (I replaced spaces with _ above for readability).  What I need for performing an "svn add" or "svn delete" is just the file path.  So, I needed to somehow get all EXCEPT the first 7 characters of the output into a variable.&lt;br /&gt;&lt;br /&gt;To do this, I ended up using the .SubString() function.  This is called with two arguments: the number of characters to remove, and the number of characters to return.   To remove the first 7 characters, I specify "7" and then the length of the string minus 7:&lt;br /&gt;&lt;blockquote&gt;$FileName = $SvnStatusLine.SubString(7,$SvnStatusLine.Length - 7)&lt;/blockquote&gt;&lt;br /&gt;Conversely, if you wanted to remove the LAST 7 characters, just reverse the position of the arguments.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update:&lt;/span&gt;&lt;br /&gt;Thanks to a knowledgeable commenter for this slicker alternative:&lt;br /&gt;&lt;br /&gt;&lt;dl id="comments-block"&gt;&lt;dd&gt;/\/\o\/\/  said...&lt;/dd&gt;&lt;dd&gt;&lt;p&gt;in this case you might consider using remove :&lt;br /&gt;&lt;br /&gt;$s = "!______D:\Path\to\some\file"&lt;br /&gt;$s.Remove(0,7)&lt;br /&gt;&lt;br /&gt;D:\Path\to\some\file&lt;br /&gt;&lt;br /&gt;Greetings /\/\o\/\/&lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;Where were you a few days ago ;-) Thanks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-4093965085831523448?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/D8DHfb6yRmo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/4093965085831523448/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=4093965085831523448" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/4093965085831523448?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/4093965085831523448?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/D8DHfb6yRmo/powershell-equivalent-of-right.html" title="Powershell equivalent of &quot;Right()&quot;" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.geekpoet.net/2007/11/powershell-equivalent-of-right.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4AQXo6fip7ImA9WxZWEEw.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-3910161861137001189</id><published>2007-11-13T07:07:00.001-08:00</published><updated>2008-03-08T14:05:40.416-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-08T14:05:40.416-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="BITS" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><category scheme="http://www.blogger.com/atom/ns#" term="Troubleshooting" /><title>Using the BITS ISAPI filter on Windows 2003 64-bit with Enable32bitAppOnWin64 enabled</title><content type="html">A problem I ran into the other day was this:&lt;br /&gt;&lt;br /&gt;We're slowly migrating from 32-bit Windows to 64-bit Windows.  To prepare, we're rolling out 2003 Standard edition, 64-bit.  Since our applications are still compiled 32-bit until we migrate off .NET 1.1, we have set IIS 6 to run 32-bit application pools by running:&lt;br /&gt;&lt;blockquote&gt;cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1&lt;/blockquote&gt;and restarting IIS.&lt;br /&gt;&lt;br /&gt;All seemed well.  Mapping .NET 1.1 (which only runs in 32-bit mode) worked fine:&lt;br /&gt;&lt;blockquote&gt;%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i&lt;/blockquote&gt;However, any attempt to surf our BITS-enabled IIS site resulted in error code 500.  Disabling IE's unhelpful "Friendly Error Messages" showed me the message "Module Not Found".&lt;br /&gt;&lt;br /&gt;So, I ran filemon to see what files were in use as I tried to hit the website.  What I noticed was w3wp.exe, one of the worker processes of IIS6, was trying to open "c:\windows\SysWOW64\bitssrv.dll" (the BITS ISAPI dll).  To confirm my settings, the "BITS Webserver Extensions" setting in my IIS6 "Webserver Extensions" pane indeed pointed to "c:\windows\system32\bitssrv.dll". In the website properties, we have a script-mapping to direct all requests to the ISAPI dll, and it too pointed to "c:\windows\system32\bitssrv.dll"&lt;br /&gt;&lt;br /&gt;Since we set IIS to use 32-bit application pools, Windows is "helpfully" translating calls for the system folder (oddly named "system32" on Windows 64-bit) to the 32-bit system folder, named SysWOW64 (does anyone know why they didn't just leave "system32" as the 32-bit folder and make a new one "system64"?).&lt;br /&gt;&lt;br /&gt;You can actually see this in action by running a 32-bit file manager (like TotalCommander) and see that attempts to surf c:\windows\system32 show different results between 32-bit and 64-bit apps.&lt;br /&gt;&lt;br /&gt;This struck me as odd because there is no bitssrv.dll in the SysWOW64 folder, only in the system32 folder (meaning there is no 32-bit BITS dll, just a 64-bit one).  To be sure, I looked on the Windows Server 2003 x64 CD, SP1 CD, and SP2 CD for a 32-bit version of the BITS dll.  Apparently, there is no 32-bit version of the ISAPI filter for a 64-bit OS.&lt;br /&gt;&lt;br /&gt;I copied the bitssrv.dll from a 32-bit Windows 2003 server to this server's "C:\Windows\SysWOW64\" folder and restarted IIS.  Voila, BITS functioned properly.&lt;br /&gt;&lt;br /&gt;I assume this is all by design, but it was annoying to discover.  What's even more annoying is that I'll need to manually update this file for any BITS-related security patches.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-3910161861137001189?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/-nOEveQdOoU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/3910161861137001189/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=3910161861137001189" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/3910161861137001189?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/3910161861137001189?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/-nOEveQdOoU/using-bits-isapi-filter-on-windows-2003.html" title="Using the BITS ISAPI filter on Windows 2003 64-bit with Enable32bitAppOnWin64 enabled" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.geekpoet.net/2007/11/using-bits-isapi-filter-on-windows-2003.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAGQH0_fip7ImA9WB9SFE8.&quot;"><id>tag:blogger.com,1999:blog-3365530156933471515.post-2235668697807061218</id><published>2007-10-03T08:08:00.000-07:00</published><updated>2007-10-03T08:18:41.346-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-10-03T08:18:41.346-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="powershell" /><title>Powershell script to create custom "compmgmt.msc" shortcuts</title><content type="html">I have several hundred servers I manage.  I like to keep a folder on my "Quick Launch" bar called "Computers" with custom shortcuts to "compmgmt.msc"  contained within, broken down by environment.&lt;br /&gt;&lt;br /&gt;This script is possible because of a feature of MMC: you can call "services.msc" or "compmgmt.msc" or probably all of them with the switch "/computer:computername" to connect to a remote computer immediately instead of having to right-click and choose "connect" once launched.&lt;br /&gt;&lt;br /&gt;Prerequisites:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;PowerShell 1.0 installed (which requires .NET Framework 2.0)&lt;/li&gt;&lt;li&gt;Windows XP or Server 2003 (not tested on 2000)&lt;/li&gt;&lt;/ol&gt;What this script does:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It creates subfolders organized as specified in a comma-delimited file to create the shortcuts in, so I can have one for each environment we have (QA, Staging, Production, etc)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It deletes existing shortcut files within the folder structure before creating new ones.  Note, however, I do not delete all shortcut files.  If you remove an entry from the CSV file, it will remain unless you delete the subfolders manually.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Script files&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can download everything mentioned in this article by clicking here: &lt;a href="http://aarondodd.com/gpdn/scripts/CreateMMC_7.10.3.rar"&gt;CreateMMC_7.10.3.rar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Note: the above archive contains an example shortcut hard-coded based on my computer.  You'll want to edit it or create a new one.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a folder to contain the shortcuts.  We'll use "MMC" here&lt;/li&gt;&lt;li&gt;Within "MMC" create a folder called "_script"&lt;/li&gt;&lt;li&gt;Within "MMC\_script" create the following:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;A comma-delimited file called "list.csv" with the following column headings: "ServerName", "IP", "Directory" (first row should read: "ServerName,IP,Directory" if using a text-editor).  For each row, fill in the proper values for each server.  "IP" can be either the IP address or FQDN.  "Directory" refers to the subfolder of "MMC" that will be created to hold the shortcut for this server.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A text file called "CreateMMC.ps1" with the following:&lt;/li&gt;&lt;br /&gt;&lt;blockquote&gt;$List = Import-CSV LIST.CSV&lt;br /&gt;$sh = new-object -com "WScript.Shell"&lt;br /&gt;$TargetPath = "%SystemRoot%\system32\compmgmt.msc"&lt;br /&gt;&lt;br /&gt;ForEach($Entry in $List) {&lt;br /&gt; # Prepend the destination directory info&lt;br /&gt; $Dir = "..\" + $Entry.Directory&lt;br /&gt;  &lt;br /&gt; # Create new folder&lt;br /&gt; New-Item -Path $Dir -ItemType Directory -Force&lt;br /&gt;&lt;br /&gt; # Build the file name and properties&lt;br /&gt; $FileName = $Dir + "\" + $Entry.ServerName + ".lnk"&lt;br /&gt; $Arguments = "/computer:" + $Entry.IP&lt;br /&gt;&lt;br /&gt; # Remove the old file&lt;br /&gt; Remove-Item $FileName -Force&lt;br /&gt;&lt;br /&gt; # Create shortcut&lt;br /&gt; $shortcut = $sh.CreateShortcut($FileName)&lt;br /&gt; $shortcut.TargetPath = $TargetPath&lt;br /&gt; $shortcut.Arguments = $Arguments&lt;br /&gt; $shortcut.Save()&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/ol&gt;&lt;li&gt;Create a shortcut of the script and save it under "MMC" taking care that the "Start In" folder is still "MMC\_script".  This is necessary if you want to just be able to click the file and have it create / update your shortcut files.  Otherwise, PowerShell will complain about not finding the script and I prefer to not hardcode paths within the script.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Double-click the shortcut within "MMC" and see how it works!&lt;/li&gt;&lt;/ol&gt;Note, you may have to enable script execution.  Powershell by default does not automatically execute scripts.  Microsoft, being overly paranoid after .vbs files being used as trojan and virus entry points, set the default execution policy for Powershell scripts to "deny".  To enable scripts, you'll need to either sign the scripts with a trusted certificate or, as I do, just enable script execution:&lt;br /&gt;"PS c:\Set-ExecutionPolicy Unrestricted"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3365530156933471515-2235668697807061218?l=blog.geekpoet.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Geekpoet/~4/XnaKj86-Z94" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.geekpoet.net/feeds/2235668697807061218/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3365530156933471515&amp;postID=2235668697807061218" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2235668697807061218?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3365530156933471515/posts/default/2235668697807061218?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Geekpoet/~3/XnaKj86-Z94/powershell-script-to-create-custom.html" title="Powershell script to create custom &quot;compmgmt.msc&quot; shortcuts" /><author><name>Aaron Dodd</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07692895356770375109" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.geekpoet.net/2007/10/powershell-script-to-create-custom.html</feedburner:origLink></entry></feed>
