netsh/Global Context |
Subcontexts
- AAAA
- DHCP
- Interface
- RAS
- Routing
- WINS
Commands
- ..
Returns to previous context.- ?
Displays help for this context.- aaaa
Enters the AAAA context (see the next entry).- abort
Discards any changes made while in offline mode.- add helper DLLfilename
Installs a new helper DLL to extend the functionality of NetShell.
The DLLs included are:- Aaaamon.dll
AAAA component DLL- Dhcpmon.dll
DHCP server DLL- Ifmon.dll
Interface DLL- Ipmontr.dll
Routing DLL- Rasmontr.dll
Remote-access server DLL- Winsmon.dll
WINS server DLL
- alias [aliasname [[string]...]]
Displays all aliases or the specified alias, or assigns string values
to the specified alias.- bye
Exits the shell (can also use quit or
exit).- commit
Commits NetShell router commands collected in offline mode and sends
them to the router.- delete helper DLLfilename
Removes an installed Helper DLL.- dhcp
Enters the DCHP context (see below).- dump filename
Dumps or appends the configuration to the specified text file.- exec scriptfile
Executes a text file containing a series of NetShell commands.- interface
Enters the Interface context (see below).- offline
Changes to offline mode. All router commands entered into the shell
are collected and can later be sent to the router using the
commit or online commands.- online
Changes to online mode. All commands entered into the shell are
executed immediately.- popd
Pops a context from the stack.- pushd
Pushes current context onto the stack.- ras
Enters the RAS context (see below).- router
Enters the Routing context (see below).- set machine
Sets the current machine on which to operate.- set mode [mode=[offline | online]]
Changes the NetShell mode.- show [alias | helper | mode]
Shows all defined aliases, installed Helper DLLs, or the current
NetShell mode.- unalias aliasname
Removes an alias.- wins
Enters the WINS context (see below).
Examples
First use Notepad to create a text file called
Script.txt , containing the following NetShell
commands, to display the authentication mode and types currently
enabled on a remote-access server:
ras
show authmode
show authtype
..
Now start the NetShell shell:
C:>netsh
Check that you are in Online mode:
netsh>show mode
online
Run the script:
netsh>exec C:\script.txt
authentication mode = standard
Enabled Authentication Types:
Code Meaning
------------------------------------------
MSCHAP Microsoft Challenge-Handshake
Authentication Protocol.
MSCHAPv2 Microsoft Challenge-Handshake
Authentication Protocol version 2.
netsh>
If you are in the command shell, you can run the script directly:
C:\>netsh -f Script.txt
Notes
- There is supposed to be a flush command for
removing commands collected in offline mode, but it
doesn't seem to work in the current release. - The dump command outputs the current configuration
of NetShell-configurable services on the machine as a series of
NetShell commands. The dumped file can then be run on a different
machine using the exec command to configure that
machine identically to the first. The only problem is that a number
of the configuration settings aren't dumped
properly! See Knowledge Base article 254252 on Microsoft TechNet for
how to edit the dump file manually to fix it.