Sunday, May 16, 2010

Issue with Airtel Broadband: Network not getting detected after reboot

 

I had this issue since last 2 months. On rebooting the machine, network address was not getting acquired. Airtel probably made some setting change and my connection got screwed up.  

To get around the issue, I was running below power shell script on reboot every time. Since it needs to be run as administrator, there is no point putting it as login script. A pain for long time. Or manually, I needed to disable and enable network interface to get network address.

NetworkInterfaceSetting.ps1
  1. #==============================================================================
  2. # 3 ways to enable and disable a physical network interface using WMI.
  3. # All boils down to finding device id of a relevant interface
  4. # All gets into a single function as you see, so this function can be
  5. # used in pipeline out of this script also.
  6. # 17 May, 2010
  7. # Tested using Powershell 2.0 on windows 7 x64 ultimate.
  8. #==============================================================================
  9.  
  10. # Function to check if PowerShell is running elevated
  11. function Check-Elevated
  12. {
  13.   $wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
  14.   $prp=new-object System.Security.Principal.WindowsPrincipal($wid)
  15.   $adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
  16.   $IsAdmin=$prp.IsInRole($adm)
  17.   if ($IsAdmin){
  18.     Set-Variable -Name elevated -Value $true -Scope 1
  19.   }
  20. }
  21.  
  22. function EnableDisableIF()
  23. {
  24.     begin {
  25.         "Enabling and disabling few nw interfaces"
  26.         $Script:Total = 0
  27.     }
  28.     process{
  29.         $Script:Executed=$true
  30.         if ($_.GetType() -eq [Int] ) { $DevID = $_ } else {$DevID = $_.DeviceID}
  31.         (gwmi win32_networkadapter -filter ("deviceid=" + $DevID)).disable()
  32.         trap {$Script:Executed = $false; continue}
  33.         if ($Script:Executed) {
  34.             (gwmi win32_networkadapter -filter ("deviceid=" + $DevID)).enable()
  35.             trap {$Script:Executed = $false; continue}
  36.         }
  37.         if ($Script:Executed) {$Script:Total += 1}
  38.     }
  39.     end{ ("Tried to Modify " + $Script:Total + " Interfaces") }
  40. }
  41.     
  42. Check-Elevated
  43. if (!$elevated) {Write-Warning "Not much advantage running as non-admin"; return}
  44.  
  45. #This should work in most cases even when network interface has been disabled for some reason
  46. $(gwmi win32_networkadapter) | ?{$_.MACAddress -ne $null} | EnableDisableIF
  47.  
  48. #I will prefer using above one, but this one can alse be used
  49. #gwmi win32_networkadapter -Filter "NetEnabled=true"  | EnableDisableIF
  50.  
  51. # Use below if you know interface id. Uncomment & change interface id to use it
  52. # 7 | EnableDisableIF

Today, while fixing some other issue, I tried Airtel NetXpert trouble-shooter randomly and issue got fixed !!! Airtel NetXpert is @ "E:\Program Files (x86)\Airtel\NetXpert\agent\bin\bcont.exe" /p nxpclient” in my x64 system. Most of the people may have it @ “C:\Program Files\Airtel\NetXpert\agent\bin\bcont.exe" /p nxpclient”.

Airtel NetXPert Properties in windows


In windows 7 & windows vista, it will require to be run from inside administrator login. This is bad design choice, but anyway.

 

 

Run it when there is no network available. That should show below screens in succession

 

Airtel NetXPert Startup screen testing connection

Be patient here for some time to get below screen.Airtel NetXPert Startup screen Troubleshooting link

 

 

 

 

Click on “Get Connected” and that should take you to Airtel NetXPert Startup screen Troubleshooting screen

 

Be patient with “Connection detection” screen and very soon you will see this screen offering to reset your network connection. Allow it to do so and done. Reboot machine to believe yourself.

No comments: