Dell E6410 Integrated HD Graphics Driver Update Causes Blue Screen of Death

If you’re not wincing already by see those feared words “blue screen of death” (BSOD) then allow me to detail how this story got even worse.  This situation may affect you if you are running Windows Server 2008 R2 on a Dell E6400 or E6500 series laptop.  If you’d like the solution steps skip down to the bottom, although you may not like what I tell you since (at the time of writing) it involves installing Server ‘08 R2 Service Pack 1 beta.

Background

Our story begins with me in Ney York for SharePoint Saturday New York City 2010 this past weekend.  I arrived Friday night for the speaker dinner and continued the night with friends for karaoke and seeing the town.  I got back to my hotel too late to give my presentation a last run through and make sure everything was in order.

The next morning I arrived at the conference venue early to finish those last minute checks I had neglected the night before.  The laptop I use for most of my work (recently upgraded to) is a Dell E6410 with Intel Integrated HD graphics card.  I dual boot it between Windows 7 and Windows Server 2008 R2 (for Hyper-V and 64 bit VMs.)  Not surprisingly I had forgotten to update the graphics drivers on my Server ‘08 R2 install to allow it to connect to a projector.  Ironically I had run into this same issue at SharePoint Saturday Michigan earlier this year on my previous laptop.  When I faced this issue that time I just installed the latest display driver appropriate for Windows 7 and was good to go in 10 minutes.  This time around I was not so fortunate.

Issue

Learning from my mistakes the previous time I went out to the Intel site and searched for the latest Windows 7 version of my display drivers.  After downloading I ran the installer.  Just as the install progress bar hit 100% and popped up the success window everything went to hell as my machine blue screened.  “Ohh no, this is not good” I exclaimed to the other speakers in the room.  Many of them offered to let me use their laptops if I couldn’t get it working, so thanks to all of them.  I didn’t panic quite yet and figured a reboot might solve the issue.  I did a hard recycle of my laptop and was greeted by a garbled welcome screen similar to the old days when you tried to tune your TV to a blocked movie channel.  Not a good sign.  I rebooted once again but this time into Safe Mode and rolled back the display drivers which got me back to square one.

Resolution

As I mentioned above, the solution to my issue was to install Server ‘08 R2 Service Pack 1 (SP1) beta (download here).  Make sure to launch your browser in “Run As Admin” mode to actually start the download.  After doing some quick searching across the interwebs I ran across this forum post on Connect.  The general consensus from comments is that Hyper-V didn’t mix well with the display drivers on my Server ‘08 R2 install.  Some users were able to correct it with SP 1 beta.  Since I only had a few hours until my presentation it was worth a shot.  I downloaded the service pack beta, ran the installer, and 30ish minutes later I was greeted by the welcome screen.  I ran the display driver update again and thankfully this time didn’t have any blue screens.  Fabian Williams actually snapped a really good picture of me waiting for the screen to come back up.

Brian Updates Display Drivers BSOD

Conclusion

There appears to be a semi-widespread issue with Dell E6400 and E6500 series laptops running Server ‘08 R2 and Hyper-V.  It may not be specific to those Dell laptops, but that’s where I’m seeing the most comments about it occurring.  I was able to resolve this issue by installing the Service Pack 1 beta (at time of writing) so that may be a solution for now.  Seeing as I’ve had this issue in the past I may start moving away from Hyper-V and towards VirtualBox or VMWare, but I’ve had really good performance out of Hyper-V so I’m still undecided.  Lesson for all of you readers is that you should always test out every aspect of your presentation well before you deliver it and have backups (screenshots, files hosted in cloud, etc.) as much as possible.

 

-Frog Out

Speaking at SharePoint Saturday New York 2010

New_York_City_Statue_of_Liberty_resized

With the busy schedule I’ve been keeping lately I realized I hadn’t even posted on here that I will be speaking at SharePoint Saturday New York (SPSNY) 2010 this weekend.  I will be presenting my “Managing SharePoint 2010 Farms With PowerShell” session for the second time ever.  The last time I presented this talk SharePoint 2010 hadn’t RTMed yet so I’ve updated the slides and demo scripts a little bit since then.  Aside from giving this presentation I’m also excited to be sitting in on a number of other amazing speakers that will also be presenting.  You can find the abstract below.  If you’ll be attending SPSNY feel free to stop in to my session.

 

Title: Managing SharePoint 2010 Farms With PowerShell”

Audience and Level: IT Admin, Beginner

Abstract: “Having you been using STSADM (or worse hand editing processes) to manage your SharePoint 2007 farms? Are you hearing about needing to learn PowerShell to manage SharePoint 2010 farms? This session will serve as part introduction to PowerShell and part overview of how you can use PowerShell to more efficiently and effectively manage your SharePoint 2010 farm. This session is targeted to farm administrators and IT pros and no previous experience with PowerShell is required.”

 

-Frog Out

Create Shortcut To Easily Edit HOSTS File On Windows 7 Or Server 2008

In this blog post I’ll show you a quick an easy way to create a shortcut to the HOSTS file on Windows 7/Server 2008+.  By itself that wouldn’t be a huge deal, but I’ll throw in a nice bonus so that you’ll add the “Run as Administrator” property so you can save the edits you make.  If you are like me and frequently need to edit the HOSTS file on a computer running with UAC enabled (Vista, Windows 7, Server 2008+) you may have run into the following error when trying to save changes:

“C:WindowsSystem32driversetchosts.txt

You don’t have permission to save in this location.  Contact the administrator to obtain permission.

Would you like to save in the My Documents folder instead?”

EditHOSTSFile5

The Issue

The error above is caused by the program you are using to edit the HOSTS (Notepad in my case) isn’t running in “Run as Administrator” mode while trying to modify a system file.  As a result it will ask you to save to a location (My Documents) that it does have access to.  Unfortunately we do need to save it to the original location.

Background on HOSTS file

For those unfamiliar, the HOSTS file is used to locally map hostnames to IP addresses and will supersede values that come from Domain Name System (DNS).  As a developer I use the HOSTS file to point my local machine to a development environment that isn’t registered in DNS or perhaps a specific server in a load balanced server farm.

The Solutions

Yes you read this section title right, I came up with multiple solutions (2 1/2 really) to this issue.  If you prefer to see me dazzle you with my PowerShell skills skip ahead to solutions #2 and #3.  If you’d like the old-fashioned “by hand” solution check out #1 below.

Solution #1

As stated above, the first solution I would consider more of a manual approach.  The first thing you will do is create a shortcut to your favorite text editing software.  Since Notepad comes with just about every Windows OS I chose that for simplicity.  One way to create the shortcut is to find it in the All Programs of your Start menu and Right Click –> Send To –> Desktop (create shortcut).

EditHOSTSFile1edited

When calling Notepad from the command line it is possible to specify the file to open automatically by listing it as a command line argument.  If your text editor doesn’t support this you’ll need to find an alternate approach.  Once you have the created the shortcut edit the properties by Right Clicking the shortcut and choosing Properties.  You will need to add the file location of HOSTS (%windir%system32driversetchosts) to the value already in the Target box shown below.  After you have added the file location to Target click the Advanced button in the lower right shown below. EditHOSTSFile2edited     On the advanced properties window you’ll want to check the box for “Run as administrator” which then allows you to edit the HOSTS file when opened in Notepad.  Click OK.

EditHOSTSFile3 If everything was successful when you double click the shortcut you should be prompted by a UAC box (because we chose to Run as Administrator) that lists the program (Notepad) and the file location (HOSTS file) to be opened.  Click Yes.

EditHOSTSFile4

Solution #2

The first PowerShell solution automates the process of creating the desktop shortcut but with one drawback: you still need to manually set the shortcut to “Run as Administrator”.  Just follow the steps from Solution #1 to add that additional piece.

Download the script here.

$wshell = New-Object -comObject WScript.Shell

$desktopPath = $wshell.SpecialFolders.Item('Desktop')


$link = $wshell.CreateShortcut("$desktopPathHOSTS.lnk")

$link.TargetPath = '%windir%system32notepad.exe'

$link.Arguments = '%windir%system32driversetchosts'

$link.Description = 'launches HOSTS file'

$link.WorkingDirectory = '%HOMEDRIVE%%HOMEPATH%'

$link.IconLocation = '%windir%system32notepad.exe'

#$link.Hotkey = "CTRL+SHIFT+H"

$link.Save()

Note: You’ll notice that I commented out the line to assign a hotkey.  I was using that hotkey as a 3-button quick test of my script results instead of multiple clicks to return to the desktop, find the shortcut, and click it.  Feel free to uncomment and use it permanently, just be sure you don’t already have a hotkey mapped to that key combination.

Solution #3 (more like #2b)

Since I couldn’t find a way to automate the setting for “Run as Administrator” in Solution #2 I continued my pursuits by “thinking outside the box.”  I thought if I can’t set that property perhaps I can launch the process in elevated mode instead.  (Sidenote: anyone familiar with Mythbusters, one of my favorite TV shows, may recognize their philosophy of attempting to recreate the results without necessarily adhering to the exact circumstances originally proposed.)  As a result what I ended up with was a shortcut on the desktop that actually runs a PowerShell command that in turn opens the HOSTS file in “Run as Administrator” mode.

Download the script here.

$wshell = New-Object -comObject WScript.Shell

$desktopPath = $wshell.SpecialFolders.Item('Desktop')


$link = $wshell.CreateShortcut("$desktopPathHOSTS.lnk")

$link.TargetPath = 'PowerShell'

$link.Arguments = '-command "Start-Process "notepad.exe" -Verb Runas -ArgumentList "C:windowssystem32driversetchosts""'

$link.Description = 'launches HOSTS file'

$link.WorkingDirectory = '%HOMEDRIVE%%HOMEPATH%'

$link.IconLocation = '%windir%system32notepad.exe'

#$link.Hotkey = "CTRL+SHIFT+H"

$link.Save()

While I do appreciate that I was able to get the results I wanted there are a few things that I don’t like about this solution.  First is that I had to hardcode the “C:…” file location for HOSTS.  While a large percentage of users will have their Windows folder on the C: drive, not all will (especially one of my home machines where Windows is on the W: drive.)  Technically I could overcome this with enough string manipulations, but I didn’t have time to mess with it.  The second issue is that I have an intermediate step of launching the PowerShell console which then runs the open Notepad command.  The PowerShell console only shows for a second or two and uses minimal resources but it’s definitely not as efficient as it could be.

Conclusion

So there you have it, 3 different ways to quickly and easily launch the HOSTS file in a save-able manner.  The first two solutions have a minor amount of manual steps required while the third is fully automated but with the drawbacks that I pointed out.  If anyone reading this knows a way to assign the “Run as Administrator” property through PowerShell I would very much appreciate a link or resource.  I spent a good chunk of time researching but came up empty handed.  I hope you were able to gain something useful from this post.  I know I had a great deal of fun researching for it.

-Frog Out

Links

Solution #2 and #3 script downloads

Solution #2 script

Solution #3 script

Create shortcut PowerShell script adapted from

http://powershell.com/cs/blogs/tips/archive/2009/04/20/create-powershell-shortcuts.aspx

Open with “Run as Admininistrator” PowerShell concept adapted from

http://powershell.com/cs/forums/p/3323/4561.aspx#4561

PowerShell Script To Find Instances Of Running SharePoint Workflow

This is a quick blog post for a fun PowerShell script I got to write today.  My client asked me to make a listing of all instances of a particular workflow currently running on one of our SharePoint farms.  Since we have dozens of SharePoint lists spread out across numerous sub-sites on this farm I decided to tackle the request with PowerShell.

Here is a quick overview of what the scrip accomplishes.  First I get a reference to the site collection in question.  Next I get the workflow template from the name of the workflow I’m checking for.  Next I search all webs within the site collection and all lists within each web.  I filter the lists for any workflow associations with a BaseId matching my workflow template Id while also having at least 1 running instance.  Once I know there are running instances on this list I can then loop through all items in the list checking for workflows that are in the “Running” state.  I then output the SPWeb name, SPList name, and SPListItem name into a delimited output.

On a side note you may notice that I use $($variable.property) in my “write-output…” command.  I do this so that the property values are evaluated first before being passed to the the output stream.  If you attempt $variable.property you’ll most likely end up with a default value for $variable (typically ToString()) followed by “.property” which is not the intended result.

Download Script

Click here for a copy of this script off my SkyDrive.

*Note: As I’m currently very busy with SharePoint Saturday Columbus tasks this script is just in draft form so no recursive traversal of site hierarchy, input parameters, comments, etc.

$workflowNameToCheck = "My Sample Workflow"
$url = "http://SharePointDemo"

$spSite = new-object Microsoft.SharePoint.SPSite($url)
$spWeb = $spSite.OpenWeb()

$workflowBase = $spweb.WorkflowTemplates | where {$_.Name -eq $workflowNameToCheck}

$spWeb.Dispose()

foreach($spWeb in $spSite.AllWebs)
{
    for($i = 0; $i -lt $spWeb.Lists.Count; $i++)
    {
        $spList = $spweb.Lists[$i]
        $assoc = $spList.WorkflowAssociations | where {$_.BaseId -eq $workflowBase.Id.ToString() `
                            -and $_.RunningInstances -gt 0}

    if($assoc -ne $null)
        {
        foreach($item in $spList.Items)
            {
                if(($item.Workflows | where {$_.InternalState -eq "Running"}) -ne $null)
                {
                    write-output "$($spWeb.Name) | $($spList.Title) | $($item.Name)"
                }
            }
        }
    }
    $spWeb.Dispose()
}
$spSite.Dispose()

Conclusion

This script (very much in draft form) checks for running instances of a given workflow within a site collection.  After writing this script today I felt that this is probably a common search for some people so I hope you can glean some useful information from it.  If you find it useful or have any questions feel free to let me know.  Enjoy!

-Frog Out

PowerShell Interview on Technology and Friends

    Three weeks ago at the Central Ohio Day of .Net 2010 conference (my recap here) I was approached by one of my Sogeti coworkers David Giard to do a guest interview on PowerShell for his popular video series Technology and Friends.  If you’ve never gotten a chance to see this series, in each episode David interviews a special guest on topics ranging across all forms of technology.  David even puts in some nice production value with music, overlays, and a special unique ending.  His series is a great way to get wide exposure to a variety of topics with a personal touch that you may not typically run into in your typical experience.  If you have any feedback on the video please feel free to leave comments here.  Enjoy the show!

 

Technology and Friends: Brian Jackett on PowerShell

http://technologyandfriends.com/archive/2010/06/28/tf097.aspx

http://www.viddler.com/player/5086095a/

 

      -Frog Out

Speaking at SPTechCon Boston 2010

    I’m happy to announce that I’ll be speaking at SPTechCon Boston 2010 this upcoming October 20-22.  The presentation I will be giving is titled “Real World Deployment of SharePoint 2007 Solutions” and below is the session abstract.  I’m very excited to be speaking at SPTechCon Boston as I attended and live blogged the recent SPTechCon San Francisco this past Feb (link here to recap of that event) and was impressed with all of the people and content I was exposed to.  If you have a chance to attend SPTechCon Boston I would highly encourage it.  Also on a side note you may notice the nice badge that the SPTechCon organizers provided on the right hand side of my blog.  Look forward to seeing you there if you’re attending.

 

Title: Real-World Deployment of SharePoint 2007 Solutions

Audience and Level: IT Admin, Intermediate

Abstract: “All I have to do is run some STSADM commands to deploy my SharePoint solutions, right?” If you are saying that to yourself, then you are missing out on some of the more advanced processes you can employ to deploy and maintain your SharePoint solutions and farm. In this session, we will cover lessons learned from three years of deploying and automating SharePoint solutions. This will include using a combination of STSADM, PowerShell, SharePoint API and a number of other tools in a real-world situation to deploy an entire suite of custom SharePoint solutions. This session is targeted to farm administrators and developers. Prior experience with SharePoint solutions, STSADM and minimal PowerShell experience is suggested.

 

      -Frog Out