Updated: April 17, 2012
Applies To: Windows 7, Windows Server 2008 R2, Windows Server 2012, Windows 8
Windows Remote Management allows you to manage and execute programs remotely. For examples of how this command can be used, see Examples.
winrs [/<parameter>[:<value>]] <command>
Specifies the target endpoint using a NetBIOS name or the standard connection:
If not specified, /r:localhost is used.
Specifies that the messages to the remote shell will not be encrypted. This is useful for troubleshooting or when the network traffic is already encrypted using ipsec, or when physical security is enforced.
By default, the messages are encrypted using Kerberos or NTLM keys.
This command-line option is ignored when HTTPS transport is selected.
Specifies username on command line.
If not specified, the tool will use Negotiate authentication or prompt for the name.
If /u[sername] is specified, /p[assword] must also be specified.
Specifies password on command line.
If /p[assword] is not specified but /username is, the tool will prompt for the password.
If /p[assword] is specified, /u[sername] must also be specified.
This option is deprecated.
Specifies starting directory for remote shell.
If not specified, the remote shell will start in the user's home directory defined by the environment variable %USERPROFILE%.
Specifies a single environment variable to be set when shell starts, which allows changing default environment for shell.
Multiple occurrences of this switch must be used to specify multiple environment variables.
Specifies that echo should be disabled. This may be necessary to ensure that user's answers to remote prompts are not displayed locally.
By default echo is "on".
Specifies that the user's profile should not be loaded.
By default, the server will attempt to load the user profile.
If the remote user is not a local administrator on the target system, then this option will be required (the default will result in error).
Specifies that the user's credentials can be used to access a remote share, for example, found on a different machine than the target endpoint.
Turn on compression. Older installations on remote machines may not support compression so it is off by default.
Default setting is off, since older installations on remote machines may not support compression.
Use an SSL connection when using a remote endpoint. Specifying this instead of the transport https: will use the default WinRM default port.
Displays Help at the command prompt.
All command-line options accept either short form or long form. For example both /r and /remote are valid.
To terminate the /remote command, the user can type Ctrl-C or Ctrl-Break, which will be sent to the remote shell. The second Ctrl-C will force termination of winrs.exe.
To manage active remote shells or WinRS configuration, use the WinRM tool. The URI alias to manage active shells is shell/cmd. The URI alias for WinRS configuration is winrm/config/winrs.
winrs /r:https://contoso.com command
winrs /r:contoso.com /usessl command
winrs /r:myserver command
winrs /r:http://127.0.0.1 command
winrs /r:http://184.108.40.206:80 /unencrypted command
winrs /r:https://[::FFFF:220.127.116.11] command
winrs /r:http://[1080:0:0:0:8:800:200C:417A]:80 command
winrs /r:https://contoso.com /t:600 /u:administrator /p:$%fgh7 ipconfig
winrs /r:myserver /env:PATH=^%PATH^%;c:\tools /env:TEMP=d:\temp config.cmd
winrs /r:myserver netdom join myserver /domain:testdomain /userd:johns /passwordd:$%fgh789
winrs /r:myserver /ad /u:administrator /p:$%fgh7 dir \\anotherserver\share