Search Wiki:
nvspcrub.js is a tool for removing Hyper-V Virtual Networking Configuration from the parent partition. It is especially useful in Server Core environments when the Hyper-V UI may not be available.

To get help for nvspscrub.js, run “nvspscrub.js /?”

/v delete disabled virtual NICs
/p purge all virtual network settings
/n purge specified NIC

If no options are specified, the default is to enumerate all virtual networks.

The /p option will delete all virtual networks (switches), virtual NICs in the parent partition and will unbind the switch protocol from all physical NICs.

Although I work for Microsoft as a developer on the Hyper-V team, I must point out that as the license tab indicates this tool and documentation are provided "as-is". You bear the risk of using it. No express warranties, guarantees or conditions are provided. It is not supported or endorsed by Microsoft Corporation and should be used at your own risk.
Last edited Feb 5 2010 at 2:35 PM  by keithmange, version 6
dflo16 wrote  Oct 14 2009 at 8:48 PM  
This script is a life saver if you accidentally remove host access for your physical network adapters and can no longer access the Hyper-V server remotely. Run this script locally from command line and it will delete the virtual adapters and put the physical adapters back to the host.

dbw17281 wrote  Dec 9 2009 at 2:34 PM  
thanks for the script, i accidentally hosed up my virtual switches and this fixed everything for me. wonderful!

RiverC wrote  Jan 21 2010 at 12:22 AM  
Do not forget that to run this script from a command line window in core server you must preface the script with cscript (IE cscript nvspscrub.js). Also it is possible to edit this script to only scrub a single network adapter if you wish to not loose everything.

keithmange wrote  Feb 5 2010 at 2:35 PM  
I added a /n option which allows you to specify a single network adapter for deletion. I also changed the default behavior of the script to only enumerate virtual network information -- you'll need to add /p to purge all settings.

r_Shashank wrote  Jul 28 2010 at 5:11 PM  
Incredibly useful! I cant describe how much trouble I could have gotten into without this script. Also, the title on this page has a typo? nvspcrub? Thanks a million!

jballew16 wrote  Dec 7 2010 at 9:14 PM  
This saves my day! Thank you for such a useful tool!

jgermies wrote  Jan 6 2011 at 5:48 AM  
This tool is very useful. Thanks for this!

Shredda wrote  Jan 22 2011 at 9:48 AM  
Thank you for developing this tool! You totally saved my Server Core installation and the associated virtual servers!

r_stitt wrote  Mar 20 2011 at 5:37 AM  
Saved my Sunday after the pain of getting connectivity to hyper-v all of Saturday. Thanks!

rjuno65 wrote  Oct 22 2011 at 1:19 AM  
Another save here, thanks!

RobAarts wrote  Oct 28 2011 at 9:25 AM  
Great script, saved my day, THX ;-)

raromstech wrote  Aug 22 2012 at 12:24 PM  
I love you man...
its been a long so glad i found you..2.33am

Rainier wrote  Oct 26 2012 at 3:30 PM  
It looked promising, reading all the comments. But on my windows 8 machine it gave me an error on line 518, char 25 Generic Failure Code 80041001 SWbemObjectSet...
I have no idea what this means, but maybe you can give it a go.

LFMc wrote  Nov 18 2012 at 10:57 PM  
Kudos!!! I can't believe you can't do this easily with sconfig.cmd.

WillemZ wrote  Oct 2 2013 at 10:24 AM  
Won't work on Windows 8:

Looking for nvspwmi...

Looking for internal (host) virtual nics...

Looking for switches...
C:\Users\Willem\Downloads\nvspscrub.js(518, 25) SWbemObjectSet: Generic failure

WillemZ wrote  Oct 2 2013 at 10:28 AM  
Btw, found the solution for Windows 8 (source is the comments in
When you get the Generic failure error, try to add the Hyper-V Extensible Virtual Switch protocol to the physical ethernet adapter inside Windows 8.

Page view tracker