Is Your PowerShell Slow to Start?

April 2nd, 2010 Justin Braun 2 comments

I ran into a scenario last week where we had loaded the Compellent Storage Center Command Set for Windows PowerShell on a server.  When we launched the shell shortcut, the window opened but took a long time to get to a PowerShell command prompt.

So, what causes slow start-up when loading PowerShell?

The most common reason seems to be that machines experiencing this slowness are not connected to the Internet.

What?

Well, when Since PowerShell is loading the Compellent Command Set DLL externally, .NET has a security feature to check Microsoft’s CRL, or Certificate Relocation List.  This process verifies the authenticity and validity of the software publisher’s certificate.  If this check can’t reach the Internet, the process will time out after several minutes.  Now, this doesn’t prevent anything from loading (which seems odd), but it takes a couple minutes for a process that should take only a couple of seconds.

The easiest resolution at this point appears to allow Internet access to the server.  If that is not possible, you can disable the check for the publisher’s certificate revocation.  You can do this from Internet Explorer (or Control Panel, Internet Options) by clicking on Tools, Internet Options.  Under the Security section of the Advanced tab, uncheck “Check for publisher’s certificate revocation”.

image

NOTE: These type of security features are in place for a reason.  Take extreme caution when considering disabling these.

Categories: Development, PowerShell, Windows Tags:

Which is the Default IP in Windows 2008 R2 Multi-IP Config?

March 27th, 2010 Justin Braun 3 comments

I ran into an interesting problem this weekend.  I noticed that a lot of email was being returned as non-deliverable from my Exchange 2010 server.  Many domains, specifically AOL and some of the major ISPs require that the domains they communicate have mail servers with reverse zone lookups, meaning that their name “mail.domain.com” for example, resolves to a specific IP.  Well, my MX record does reverse resolve to the correct IP, however that IP wasn’t the IP address that my server was communicating from.

My infrastructure goes through a firewall.  It used to be Microsoft ISA Server, but recently I have been trying the new Forefront Threat Management Gateway.  One of the nice things is TMG is supported on Windows 2008 and R2, and can be virtualized as well.  I built mine on Windows 2008 R2, which appears to be part of my identity problem, at least as far as other domains are concerned.

Normally on a network card that has multiple IP addresses assigned to it, the first IP listed will be the one that is used for communication.  In the case of Windows 2008 (and R2), it actually changes to use the lowest IP address (number-wise).  So if my IP ends with 12, and another one ends with 14, even though 14 might be listed first, it will always use 12.  From what I understand and without getting into too much detail, there is something called strong and weak host models.  It’s hardcore networking, so if you want, you can read more here and here.

Microsoft recognized this as an issue and released a hotfix for Windows 2008 SP2 and Vista SP2, but the hotfix doesn’t cover R2.  Basically this hotfix adds a parmeter called SkipAsSource which can be set per interface via NETSH.  After you install this hotfix, you can create IP version 4 (IPv4) addresses or IP version 6 (IPv6) addresses by using the netsh command together with the new "skipassource" flag. By using this flag, the added new addresses are not used for outgoing packets unless explicitly set for use by outgoing packets. Therefore, these IP addresses will not be registered on the DNS servers.  This also induces the behavior as you knew it in Windows 2003.

Now, since I am running R2, this really didn’t help me, but a slight change in configuration in TMG did.  In the Networking configuration inside TMG, I have a rule for anything accessing the Internet.  I can control from here what IP is used to talk to the Internet; this would be the IP address that my mail server would be seen as through Network Address Translation (NAT) on its way to the interwebs.

image

You can configure the NAT rule to use any or all of your externally routable IP addresses.  Problem resolved!

Categories: Windows Server Tags:

Hidden Windows 7 Themes

March 27th, 2010 Justin Braun No comments

I came across this one this week.  Did you know there are a few hidden themes built-in to Windows 7?  They’re in a hidden directory, so you’ll have to type their path directly or use search with the option to location hidden files or folders.

If you navigate to C:\Windows\Globalization\MCT you’ll find several different directories.  Inside of each of those folders is a directory called “Theme”.  If you open that folder, you’ll see a .theme file which you can double-click to activate the theme.  My favorite is the UK theme.

Categories: Windows Tags:

Windows Experience Index – Parallels vs. Fusion: How Do They Stack Up?

March 18th, 2010 Justin Braun 3 comments

Since the release of Parallels 5 I have been a huge fan.  Previous to that, I really liked VMware Fusion as the product was much more mature and seemed more stable.  I really had no means to measure performance other than to gauge it by my perception over regular use.

Earlier this week, VMware announced their VMware Fusion 3.1 beta, which I had to run out and try.  I like to keep tabs on both of these products and am always curious when either of them releases an update.

That being said, I downloaded the beta ad built up a new Windows 7 virtual machine, installed the machine additions and played around a little bit.

In the past I’ve done things like measure the boot time for the operating system on each product and in most cases Parallels topped Fusion.  Especially after Parallels released version 5, the gap between those numbers seemed to grow especially when it came to the amount of time it takes to come back on a resume.

As part of my test I also built a new Parallels virtual machine with Windows 7 installed.  I thought an equal way to measure the differences would be by running the tests that provide the results of the Windows Experience Index.  The scale of the Windows Experience Index ranges from 1.0 to 5.9. A higher base score generally means that your computer will perform better and faster than a computer with a lower base score, especially when performing more advanced and resource-intensive tasks.

This host hardware was an iMac with a Core 2 Duo 2.8 GHz processor and equipped with 4 GB of RAM.  Each virtual machine (although not ran simultaneously) had 1 GB of RAM allocated to it.

So, how did each virtual machine fair?  I was actually very surprised.  As VMware has touted lots of improvements around its graphics driver and performance, it actually seemed slower than the 3.0 release.

Here’s how the numbers stacked up:

VMware Fusion Results:

fusion

Parallels Desktop Results:

fusion

Interestingly enough, it seems that Parallels does a better job in more of the categories than not.  Parallels implementation and support of Aero in Windows 7 seems to be more solid as well.

What has your experience been with these products?  Have you found the optimal virtual machine configuration on your Mac?

Categories: Mac, Virtualization Tags:

Using Excerpts in WordPress

March 11th, 2010 Justin Braun No comments

I was working on making some adjustments to a new theme in WordPress tonight and was looking for a way to check to see if a excerpt had been specified for a particular post.  When I am creating posts with code snippets in them, I really don’t want all the inline code to show in the excerpt of the post, instead, it should all be rendered when the post is opened.

Seeing as I am fairly new to PHP, I had to do some searching so I wasn’t able to craft a solution easily myself.  I found just what I was looking for over at juliaholland.org.

Categories: Development Tags:

Search Your Compellent Storage Center Using Windows PowerShell

March 3rd, 2010 Justin Braun No comments

Using Windows PowerShell and the Compellent Storage Center Command Set for PowerShell, I have created a simple script that performs searches for server and volume objects providing results of each in addition to their related mappings.  This can be helpful if you have multiple levels of server or volume folders.

# Name:       Storage Center Search
# Usage:      Search for volume or server objects across a Storage Center
# Author:     Justin Braun
# Date:              February 17, 2010

# This sample script is provided "as is" with no warranty whatsoever; 
# you assume all responsibilty of the consequences of use.

$scname = Read-Host "What Storage Center do you want to search? (IP or hostname)"
$scusername = Read-Host "What is the username for your account on this Storage Center?"
$scpassword = Read-Host -AsSecureString -Prompt "What is the password?"
$findsource = Read-Host "What type of object are you looking for? (S=server, V=volume)"
$searchterm = Read-Host "Enter the text you want to search for (wildcards OK)"

if($findsource -ne "S" -and $findsource -ne "V")
{
       # Invalid parameter entered.
       Write-Host "`nInvalid search source specified.`n" -ForegroundColor Red
       Break
}

# Valid parameter found - start script

# Instantiate connection
Write-Host "`nOpening connection...";

try
{
       $conn = Get-SCConnection -HostName $scname -User $scusername -Password $scpassword;
}
catch
{
       Write-Host "Error: " $_;
       Break;
}

Write-Host "Connection established to $scname...";

# What are we searching for?
switch ($findsource)
{
       "S"
       {
              # Find a server
              $servers = Get-SCServer -Connection $conn | where { $_.Name -like $searchterm }

              if($servers -ne $null)
              {
                     # Found some objects that might match
                     Write-Host "`nThe following servers might match your query:"
                     $servers | ft -AutoSize Name, LogicalPath, WorldWideNames
              }
              else
              {
                     # No objects found
                     Write-Host "`nSorry, no objects were found that match your query."
              }
       }

       "V"
       {
              # Find a volume
              $vols = Get-SCVolume -Connection $conn | where { $_.Name -like $searchterm }

              if($vols -ne $null)
              {
                     # Found some objects that might match
                     Write-Host "`nThe following volumes might match your query:"

                     foreach($vol in $vols)
                     {
                           # Create an output object for table formatting
                           $obj = new-Object PSObject;

                           # Add member properties with their name and value pair
                           $obj | Add-Member NoteProperty VolumeName($vol.Name);
                           $obj | Add-Member NoteProperty LogicalPath($vol.LogicalPath);

                           #Get Mappings to volume
                           $mappings = Get-SCVolumeMap -VolumeIndex $vol.Index -Connection $conn

                           if($mappings -ne $null)
                           {
                                  $maps = ""
                                  foreach($mapping in $mappings)
                                  {
                                         $maps += $mapping.ServerName + " "
                                  }

                                  $obj | Add-Member NoteProperty Mappings($maps);
                           }
                           else
                           {
                                  # No mappings found
                                  $obj | Add-Member NoteProperty Mappings("None");
                           }

                           # Write the output to the screen
                           Write-Output $obj;
                     }
              }
              else
              {
                     # No objects found
                     Write-Host "`nSorry, no objects were found that match your query."
              }
       }
}

If you have ideas for scripts or would like to share your creations with other Compellent customers, check out the Forums at the Compellent Customer Portal. [authentication required]

Categories: Compellent, PowerShell, Scripting Tags:

Create a Disk Image Installer on the Mac

February 8th, 2010 Justin Braun No comments

I was working on a project for my father-in-law where he wanted to distribute his yearly catalog via CD instead of the traditional printed method.

I wanted to design a CD image that would work on both Windows and Mac.  I was able to solve the PC side of it pretty quickly, but needed some guidance on creating a DMG on the Mac.  They can get pretty fancy.

My wife designed the background art for the DMG when it is opened and with some guidance from a few different sites, I was on my way.

Peter Ahe’s Blog was helpful in getting me going on the right direction and understanding what was required to get the disk image installer created.

Some other good resources:

How to Create a Hybrid CD on the Mac
http://www.sonsothunder.com/devres/revolution/tips/disk006.htm

How to Create a Custom DMG Installer
http://www.ploem.be/blog/?page_id=26

Categories: Mac Tags:

Perfectly Centered via CSS

February 8th, 2010 Justin Braun No comments

One thing that has always been a struggle is how to perfectly center an object (for example, a DIV) both horizontally and vertically on a page. 

The other night I was searching for a better way to do this via CSS instead of using nested tables.  I came across Dead Centre, a website that demonstrates exactly how to accomplish this.  You can see some of the detail on the webpage itself, but also take a look at the source for more details on how this was executed.

This provided a truly dynamic design that was 100% CSS-based and works across all browsers.

Categories: Development Tags:

VMware Fusion 3 or Parallels 5?

January 3rd, 2010 Justin Braun No comments

It’s a bitter battle between the two – which provides the best feature set while maintaining optimal performance?  I’ve tried both, been back and forth, and can’t quite decide for myself.  Have you tried either or both?  Which do you prefer and why?

Categories: Mac, Virtualization Tags:

I’m Giving Up On NetNewsWire (for now)

December 14th, 2009 Justin Braun No comments

I’ve been very loyal to NetNewsWire for a long time. Whether it be NewsGator (a RSS plugin for Outlook), FeedDamon (an RSS feedreader app for Windows, NetNewsWire on the iPhone, or NetNewsWire on the Mac.

In the fall, NetNewsWire was switched to synchronize with Google Reader accounts. I just can’t take the inconsistencies in synchronization that occur when using NetNewsWire on my Mac. I spend an hour or two going through a couple hundred or more news items all for them to reappear as unread items next sync period – sometimes, other times they stay unread.

NetNewsWire is a desktop RSS application for the Mac. You can use it for free with embedded advertising, or you can buy it for $20. I’m all about supporting developers who write apps – but I can’t do that for NetNewsWire.

The best alternative that I could find for now is an app called Gruml.  Gruml also allows you to view and manage your feed subscriptions of your Google Reader account on Mac OS X.  It is in the beta stage, so there are some quirks, but the developer was releasing updates pretty regularly until the middle of November. Hopefully there is a final release or something big up his sleeve.

Nonetheless, Gruml at least gets it write when it comes to the synchronization, so for now, it’s my choice for a desktop RSS reader.

Categories: Reviews, Software Tags: