Useful Hyper-V utilities (for the Core guys)
When setting up demos, labs or just showing customers how to do various stuff in Hyper-V / Server Core / Windows sometimes things get screwed up. Or you need to disable/enable something that’s been turned on/off. In Core this can of course be a challenge, and I’ve lately run across a few different utilities and built in commands that might help you get through your 8 hours with slightly less hassle.
Netcfg can be used to enumerate and show adapters, networking services and protocols. Installation and removal of the same components can also be done with netcfg.
When run in a command prompt just running netcfg
netcfg [-v] [-e] [-winpe] [-l -i The arguments must be passed in the order shown. Examples: netcfg -c s -i MS_Server OR netcfg [-v] -winpe OR netcfg [-v] -q OR netcfg [-v] [-e] -u OR OR netcfg [-v] -b General Notes:n” See the pictures for listing adapters and protocols. hvremote.wsf nvspbind nvspcrub.js
-winpe installs TCP/IP, NetBIOS and Microsoft Client for Windows preinstallation envrionment
-l provides the location of INF
-c provides the class of the component to be installed (p == Protocol, s == Service, c == Client)
-i provides the component ID
netcfg -l c:oemdirfoo.inf -c p -i foo
…installs protocol ‘foo’ using c:oemdirfoo.inf
…installs service ‘MS_Server’
netcfg -v -winpe
…Installs TCP/IP, NetBIOS and Microsoft Client for Windows preinstallation environment
netcfg -q MS_IPX
…displays if component ‘MS_IPX’ is installed
netcfg -u MS_IPX
…uninstalls component ‘MS_IPX’
netcfg -b ms_tcpip
…shows binding paths containing ‘MS_TCPIP’
-v Run in verbose (detailed) mode
-e Use servicing environment variables during install and uninstall
-? Displays this help information
Hvremote lets you configure remote administration of Hyper-V hosts either it be the server or the client that’s not in a domain and so on. On the download page for hvremote they have an excellent 10-second guide so I’m not gonna give you the syntax, I’ll just send you straight over there: http://archive.msdn.microsoft.com/HVRemote.
Nvpsbind lets you enable or disable network protocol bindings on adapters by using the command line. In Server Core or Hyper-V Server this isn’t possible otherwise since the control panel applet isn’t available (that’ll be the ncpl.cpl). Check this out for more information!
And if you use the above utility a little too much, or just happen to remove the Hyper-V role from a Core-box you might need this script to rescue you. It’ll reset the network configuration and remove the Hyper-V networking components. Read more and download!
The arguments must be passed in the order shown.
netcfg -c s -i MS_Server
netcfg [-v] -winpe
netcfg [-v] -q
netcfg [-v] [-e] -u
netcfg [-v] -b
See the pictures for listing adapters and protocols.