Atlanta .NET Regular Guys

News

Brendon Schwartz - Email Me
Matt Ranlett - Email Me

Brendon Schwartz

MVP Logo
Community Kit for SharePoint
View Brendon Schwartz's profile on LinkedIn

Matt Ranlett

Matt Ranlett MVP Logo

Community Links

Useful Links

SharePoint 2007

ASP.NET 2.0

Atlanta Area Bloggers

BizTalk

SharePoint 2007 WebControls

SharePoint 2007 Development

Netsh - a hidden commandline gem

The most recent issue of Windows IT Pro magazine has a short 1 page article from Mark Minasi about Netsh Tricks.  The article piqued my interest so I went out to learn a little more about it.

Netsh is the result of a joint effort between Microsoft and Cisco Systems back in the early Windows 2000 days.  Netsh allows you to control IP addresses, gateways, DNS servers, and more from the command line.  It also lets you do some neat troubleshooting tasks.

Try out Netsh yourself.  Hit StartRun, type CMD and hit OK.  Type “netsh ?” and you’ll get a list of 14 different context sensitive commands.  Let’s take a quick look at how to change the IP address of your machine.  This can be useful if you’re setting up a lab and you want to keep it partitioned by subnet from other labs.  You could run the following commands:

View the network IP configuration with this command:
       netsh interface ip show config
Get these results
       Configuration for interface "Local Area Connection"
           DHCP enabled:                         Yes
           InterfaceMetric:                      0
           DNS servers configured through DHCP:  10.1.0.5
                                                                                10.1.0.4
                                                                                10.1.0.10
           WINS servers configured through DHCP: 10.1.0.9
           Register with which suffix:           Primary only

 Change your machine’s static IP address with these commands
       netsh interface ip set address name="Local Area Connection"
       netsh interface ip set address local static 150.100.1.2 255.255.255.0 150.100.1.1 1

 

Having problems with your PC’s network connection and want to completely rebuild the entire IP stack?  Try this command:
       netsh int ip reset c:\iplog.txt

If that doesn’t work you could try resetting the entire Winsock catalog, which might be necessary if you’ve recently been the victim of spyware
       netsh winsock reset

Want to get an HTMLview of every part of your system including OS build number, service pack number, free memory, and more?  This can be accomplished by this command
       netsh diag gui

NetshDiagnostics

Netsh can be a very powerful tool as it eases configuration changes via scripting.  Learn more about Netsh from the Microsoft Documentation

Posted: Aug 21 2006, 05:55 AM by Matt Ranlett | with no comments
Filed under:

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)