Back From TechEd: Fixing Name Resolution Issue with PowerShell

I really enjoy going to TechEd every year where I get to meet old friends and make new friends. It is also a great opportunity to speak with our users face to face. The one thing I do not enjoy about TechEd (and this seems to happen every year) is that upon return to the office, my computer no longer can discover other computers on any network, nor can I connect to a network share using the machine name. At some point during TechEd, I connect to a wireless network and it decides to change my network node type to Peer-To-Peer, which inevitably results in me pulling my hair trying to figure out why my UNC paths no longer work and returns an unknown error; yet I can still ping the machines by IP. So if you were wondering why each year it seems like my hair is thinning, you now know why (well part of the reason). To determine if the node type is altered from the default, type the following in your console: ipconfig /all ipconfig /all Make sure it the Node Type says ‘Hybrid’ and not ‘Peer-To-Peer’.   Since this issue has happened more than once, I decided to create a small PowerShell function to resolve this issue: Fix-NetworkNodeType (aka Fix-WhatTechEdBroke) Note: The function requires that you have admin rights in order to delete the necessary registry entries.

<#
    .SYNOPSIS
        Changes the network node to Hybrid.
    
    .DESCRIPTION
        Fixes a name resolution issue that is caused by connecting to a TechEd Wi-Fi network.
        The computer’s network node type is set to ‘Peer-To-Peer’ instead of the default ‘Hybrid’. 
        This function deletes two registry values to resolve the issue.
    
    .PARAMETER Reboot
        Specify if you want to reboot the machine.
    
    .NOTES
        The computer must be rebooted in order for the changes to take affect.
#>
function Fix-NetworkNodeType 
{
    param([switch]$Reboot)
    
    $Path = "HKLM:\System\CurrentControlSet\Services\NetBt\Parameters"
    Remove-ItemProperty -Path $Path -Name NodeType -Confirm  
    Remove-ItemProperty -Path $Path -Name DhcpNodeType -Confirm  
    if ($Reboot) 
    { 
      Restart-Computer 
    } 
}

As you can see the solution is very easy; you just have to delete two registry values and restart the PC. Please refer to this article for more details on the solution: http://support.microsoft.com/kb/903267/en-us