Search The Web

Showing posts with label netsh. Show all posts
Showing posts with label netsh. Show all posts

Sunday, February 17, 2013

Windows 2008 Sever Core / Dos Networking Netsh Commands

Windows 2008 Sever Core / Dos Networking Netsh Commands

Some Common command line tools for Networking in Server 2008 and Dos:
  • to set IP in Dos / 2008 server core: netsh interface ipv4 set address name=2 source=static address= mask= gateway=
  • use netshell to verify the "name" of the interface: netsh interface ipv4 show interfaces
  • to set DNS server IP in server core: netsh interface ipv4 add dnsserver name=2 address= index=1
  • to name a server in server core: netsh renamecomputer %computername% /newname: /userd: /passwordd: /reboot:0  .  Note: the dd in passwordd is not a mistype, its the spelling that is used the reboot:0 will force the machine to reboot
  • to join a domain:
    netdom join %computername% /domain: /username: /passwordd /reboot:0

  • to disable firewall: netsh advfirewall set allprofiles state off

  • use ocsetup command to add / remove roles
  • to uninstall DNS: ocsetup DNS-Server-Core-Role /uninstall
  • to uninstall DHCP: ocsetup DHCPServercore /uninstall
  • to enable remote management so it can be be administered from remote computer:  
    1. WinRM quickconfig (on the remote comp)

Sunday, March 11, 2012

stop and start network adapters in a batch file or DOS using netsh

Stop and Start Network Adapters in a Batch File or DOS using netsh.


Sometimes you may want to stop and start network adapters from a command line. This is especially true for when you want to use them in a DOS batch file.
To do this we are going to use Net Shell (netsh) which is a powerful command line based tool for managing network properties. net shells capabilities extend far beyond what we are doing here and i encourage you to investigate this further. To get a list of commands try typing " netsh /? " at a command line
netsh /? to display a list of net shell options
netsh /? to display a list of net shell options
Firstly you will want to find the name of the adapter. to do this, open Network and Sharing Center (in Win 7 and Vista) and choose Change adapter settings. Typically, the a LAN connection is named " Local Area Connection " and a wireless connection is named " Wireless Network Connection " . This can also be discerned from looking at an ipconfig read out, where for a LAN connection is will say Ethernet Adapter Local Area Connection " . if doing this remember to drop the Ethernet adapter portion of the name.
Another way to find the name is to open a DOS command and enter netsh interface show interface. The name listed in the interface name is the name of the connection. In this case was are focusing on the Wireless Network Connection
Use netsh interface  show interface  to show interface name in dos / powershell
Use netsh interface show interface to show interface name in dos / powershell
For this example we will use a wireless network adapter with the default name of "Wireless Network Connection"
The command to disable this connection is:
netsh interface set interface "Wireless Network Connection" DISABLE
netsh interface set interface " name" enable to enable interface in dos / powershell
netsh interface set interface " name" enable to enable interface in dos / powershell
to enable the adapter again, the command is:
netsh interface set interface "Wireless Network Connection" ENABLE
netsh interface set interface "<name>" enable to enable network interface is dos / powershell
netsh interface set interface "" enable to enable network interface is dos / powershell
as you can see, this would be really easy to put in a batch file to put in a start up or deploy in other methods.
for a video tutorial on this, please check the youtube video below:


This post can also be located at our sister site www.dizzyit.com at: http://wp.me/p1Zlmi-1u