netsh/Global Context |
Commands available in every NetShell context.
Returns to previous context.
Displays help for this context.
Enters the AAAA context (see the next entry).
Discards any changes made while in offline mode.
Installs a new helper DLL to extend the functionality of NetShell. The DLLs included are:
AAAA component DLL
DHCP server DLL
Interface DLL
Routing DLL
Remote-access server DLL
WINS server DLL
Displays all aliases or the specified alias, or assigns string values to the specified alias.
Exits the shell (can also use quit or exit ).
Commits NetShell router commands collected in offline mode and sends them to the router.
Removes an installed Helper DLL.
Enters the DCHP context (see below).
Dumps or appends the configuration to the specified text file.
Executes a text file containing a series of NetShell commands.
Enters the Interface context (see below).
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.
Changes to online mode. All commands entered into the shell are executed immediately.
Pops a context from the stack.
Pushes current context onto the stack.
Enters the RAS context (see below).
Enters the Routing context (see below).
Sets the current machine on which to operate .
Changes the NetShell mode.
Shows all defined aliases, installed Helper DLLs, or the current NetShell mode.
Removes an alias.
Enters the WINS context (see below).
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
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.