Saturday, April 3, 2010

A computer that is connected to an IEEE 802.1X authenticated network does not connect to the correct network after you resume it from Hibernate mode or Sleep mode

The heading says it all. In this scenario, the computer is not connected to the authenticated Virtual Local Area Network (VLAN) that it previously inhabited. Instead, the computer is connected to an isolated network.

If have this issue, there is an easy fix for Windows 7 machines. Check it here: A computer that is connected to an IEEE 802.1X authenticated network through a VOIP phone does not connect to the correct network after you resume it from Hibernate mode or Sleep mode.

Now if you have Windows XP SP3 computers, you are out of luck. above MSKB says,

Note This issue occurs in Windows XP. However, a hotfix will not be made available because the issue was found outside of the Windows XP mainstream support life cycle.

The same MSKB explains some manual workarounds:

    • Restart the computer.
    • Reset the network adapter. To do this, start an elevated command prompt, type netsh lan reconnect, and then press ENTER.
    • Unplug and then reconnect the network cable.
    • Use a third-party network driver. If a third-party driver, such as Cisco DNE, is installed, this driver changes the behavior and causes automatic authentication.

But I wanted an automatic solution like the hot fix for Windows 7 and Vista machines.  So I wrote the following script and run it at startup on all XP SP3 machines. I am waiting for “PowerManagementEvent”, specifically event 7. When it happens I run “NetSh LAN Reconnect”. Copy and paste the following code in notepad, save it as Wakeup.vbs and run it in Startup. 

You can also download it here: WakeUp.vbs

 

'********************************************************************************************************************
' Script: WakeUp.vbs
' Purpose: When computer wakes up from sleep or hibernation, detect the event and reconnect the LAN interface
' Written by: Anand Venkatachalapathy
' Creation Date: 3/29/2010
'********************************************************************************************************************

'No error will be displayed on the screen
On Error Resume Next

Set oShell = CreateObject("WScript.Shell")

'Register Power Management Event
Set colMonitoredEvents = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent")

'Never ending loop
Do
'Collect the event
Set oSuspend = colMonitoredEvents.NextEvent
'If the event type is 7, then computer is waking up
If oSuspend.EventType = 7 Then
'Reconnect the LAN interface
sCmd = "netsh lan reconnect"
oShell.Run sCmd,0,True
End If
'Sleep for few seconds
WScript.Sleep 3600
Loop

'**** End Of Script ****

No comments:

Post a Comment

Followers

hit counter