DESKTOP

Windows 8 : Using other management tools remotely (part 1) - Netsh, Windows Remote Shell

8/8/2014 4:12:52 AM

Netsh

Netsh has been around for several versions of Windows and is used to manage networking components on both local and remote computers. This command-line tool and scripting shell can help troubleshoot, correct, and automate working with network adapters and other components in Windows.

Netsh allows many parameters, listed in Table 1, to help with different components and scripts, both locally and remotely.

Table 1. Netsh command options

Netsh command

Details

Help or ?

Displays the help for Netsh

Add helper

Adds a Netsh helper DLL

Delete helper

Removes a Netsh helper DLL

Show helper

Lists the installed helper DLLs

Cmd

Starts a command-line session

Online

Sets Netsh to online mode

Offline

Sets Netsh to offline mode

Set mode

Changes the mode of Netsh to online or offline

Show mode

Displays the current mode of Netsh

Flush

Discards changes in offline mode

Commit

Saves changes in offline mode

Set machine

Selects the computer on which Netsh commands will run

Exec

Executes a script file with Netsh commands

Quit, bye, exit

Exits Netsh

Add alias

Creates an alias for an existing Netsh command

Delete alias

Removes an alias for an existing Netsh command

Show alias

Lists all existing Netsh aliases

Dump

Writes configuration to a text file

Popd

Script command that removes the current context from the Netsh stack

Pushd

Script command that pushes the active context onto the stack

Netsh can help you accomplish many things. Many real-world examples work with network interfaces. Netsh can be used to modify the IP address or reset the TCP/IP stack for an adapter if the GUI is not available.


Windows Remote Shell

Windows Remote Shell (WinRS) is designed to help you work on and troubleshoot problems on remote Windows systems from the command line. It enables execution of any shell-based commands that might work in the command shell (Cmd.exe) against remote computer systems. Using WinRS can speed up performance of routine tasks because it doesn’t require visits to each machine.

Before using WinRS on computers in an environment, the computers must have Windows Remote Management (WinRM) configured to accept connections. The most straightforward way to accomplish this goal is as follows:

  1. Open an elevated command prompt.

  2. Type the command WinRM quickconfig and press Enter.

  3. When the prompt appears asking if you’d like to accept the proposed changes, type Y and press Enter.

  4. Await the return of a message indicating that the process was successful.

This command carries out the following actions:

  • Starts the WinRM service and sets the service startup type to auto-start

  • Configures a listener for the ports that send and receive WS-Management protocol messages using either HTTP or HTTPS on any IP address

  • Defines firewall exceptions for the WinRM service and opens the ports for HTTP and HTTPS

After WinRM has been configured, you can move on to managing WinRS.

The available switches for WinRS are:

  • -r[emote]:endpoint Tells WinRS to connect to a remote system when endpoint is the computer name for the remote system.

  • -un[encrypted] Determines whether the connection to the specified machine should be unencrypted.

  • -u[sername]:username Specifies the user name credential used to connect to the remote system.

  • -p[assword]:password Specifies the password for the credential needed to connect to the remote computer.

  • -d[irectory]:path Specifies the starting directory for WinRS on the remote system.

  • -env[ironment]:string=value Sets an environment variable on the remote system when the session begins. This switch supports multiple occurrences for multiple environment variables.

  • -noe[cho] Disables echo or screen output. In some cases, answers to remote commands need not be displayed locally. Echo is turned on by default.

  • -nop[rofile] Prevents the user profile from loading during the session. If the connecting user is not an administrator on the local computer, the -nop switch is required to prevent profiles from loading.

  • -comp[ression] Enables compression. This option is turned off by default because older computers might not support the option.

  • -[use]ssl Connects to a remote computer by using a Secure Sockets Layer (SSL) connection on the default WinRM port instead of HTTPS, which uses port 443.

  • -? WinRS help.

WinRS is useful for performing command-line tasks on remote computers. Many administrators might already know these tasks and use them frequently on local machines. Using WinRS will keep the syntax the same for many commands so they can be executed easily on other systems. Many of the commands available from the command line can also be performed in Windows PowerShell, but in some cases, the syntax is different. WinRS can ease this learning curve.

The syntax for a WinRS command is as follows:

WinRS -r:Server02 cmd

Specify WinRS, and then use the -r switch with a computer name to point the connection to a remote system and issue the command to open a command prompt.

WinRM quickconfig

Using quickconfig will ready your system to accept connections on the remote management port.

Other  
  •  Windows 8 : Configuring, managing, and troubleshooting connections (part 3) - Connecting to VPNs in Windows 8
  •  Windows 8 : Configuring, managing, and troubleshooting connections (part 2) - Using Troubleshooter
  •  Windows 8 : Configuring, managing, and troubleshooting connections (part 1) - Troubleshooting network problems
  •  Windows 8 : Configuring and using Remote Desktop (part 3) - Programs, Experience, Advanced
  •  Windows 8 : Configuring and using Remote Desktop (part 2) - Opening the Remote Desktop application - General, Display, Local Resources
  •  Windows 8 : Configuring and using Remote Desktop (part 1) - Configuring Remote Desktop
  •  Windows 8 : Working with Remote Assistance - Initiating Remote Assistance, Providing remote assistance
  •  Windows 8 : Managing authorization and access rights (part 4) - Run As,Using and managing certificates
  •  Windows 8 : Managing authorization and access rights (part 3) - Running tasks as administrator and user account control
  •  Windows 8 : Managing authorization and access rights (part 2) - Local Security Policy console
  •  
    Top 10
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    3 Tips for Maintaining Your Cell Phone Battery (part 1) - Charge Smart
    OPEL MERIVA : Making a grand entrance
    FORD MONDEO 2.0 ECOBOOST : Modern Mondeo
    BMW 650i COUPE : Sexy retooling of BMW's 6-series
    BMW 120d; M135i - Finely tuned
    PHP Tutorials : Storing Images in MySQL with PHP (part 2) - Creating the HTML, Inserting the Image into MySQL
    PHP Tutorials : Storing Images in MySQL with PHP (part 1) - Why store binary files in MySQL using PHP?
    Java Tutorials : Nested For Loop (part 2) - Program to create a Two-Dimensional Array
    Java Tutorials : Nested For Loop (part 1)
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS