diff --git a/examples/example.aliases.drushrc.php b/examples/example.aliases.drushrc.php
index 6d68359..a6f61c7 100644
--- a/examples/example.aliases.drushrc.php
+++ b/examples/example.aliases.drushrc.php
@@ -125,6 +125,16 @@
  * - 'os': The operating system of the remote server.  Valid values
  *     are 'Windows' and 'Linux'.  Default value is PHP_OS if 'remote-host'
  *     is not set, and 'Linux' (or $options['remote-os']) if it is.
+ * - 'winrs-password': If the target is a remote Windows machine, then
+ *     the winrs password may be set with this option; however, this is
+ *     not recommended.  It is preferable to instead use the Windows
+ *     `cmdkey` command to cache the credentials for your site:
+ *
+ *          cmdkey.exe /add:your-remotehost.domain.com /user:USERNAME /pass:PASSWORD
+ *
+ *     If you do this, then Windows will add your credentials automatically,
+ *     and it is not necessary to specify 'remote-user' or 'winrs-password'
+ *     in your site alias.
  * - 'ssh-options': If the target requires special options, such as a non-
  *     standard port, alternative identity file, or alternative
  *     authentication method, ssh- options can contain a string of extra
diff --git a/includes/backend.inc b/includes/backend.inc
index 8f15726..8c5f9c8 100644
--- a/includes/backend.inc
+++ b/includes/backend.inc
@@ -646,7 +646,6 @@ function _drush_backend_generate_command_sitealias($site_record, $command, $args
 
   $hostname = $site_record['remote-host'];
   $username = $site_record['remote-user'];
-  $ssh_options = $site_record['ssh-options'];
   $drush_path = $site_record['path-aliases']['%drush-script'];
   $os = drush_os($site_record);
 
@@ -676,9 +675,19 @@ function _drush_backend_generate_command_sitealias($site_record, $command, $args
   }
   $cmd = $drush_command . " " . $option_str . " " . $command . (empty($backend_options['interactive']) ? " --backend=2" : "");
   if (!is_null($hostname)) {
-    $username = (!is_null($username)) ? drush_escapeshellarg($username, "LOCAL") . "@" : '';
-    $ssh_options = (!is_null($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no");
-    $cmd = "ssh " . $ssh_options . " " . $username . drush_escapeshellarg($hostname, "LOCAL") . " " . drush_escapeshellarg($cmd . ' 2>&1', "LOCAL") . ' 2>&1';
+    if (drush_is_windows($os)) {
+	  $username = (!is_null($username)) ? " -u:" . drush_escapeshellarg($username, "LOCAL") : '';
+	  if (array_key_exists('winrs-password', $site_record)) {
+	    $username .= " -p:" . drush_escapeshellarg($site_record['winrs-password'], "LOCAL");
+	  }
+      $cmd = "winrs" . $username . " -r:" . drush_escapeshellarg($hostname, "LOCAL") . " " . drush_escapeshellarg($cmd, "LOCAL");
+	}
+	else {
+	  $username = (!is_null($username)) ? drush_escapeshellarg($username, "LOCAL") . "@" : '';
+      $ssh_options = $site_record['ssh-options'];
+      $ssh_options = (!is_null($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no");
+      $cmd = "ssh " . $ssh_options . " " . $username . drush_escapeshellarg($hostname, "LOCAL") . " " . drush_escapeshellarg($cmd . ' 2>&1', "LOCAL") . ' 2>&1';
+    }
   }
   else {
     // TODO: `tty` is not usable on Windows.  Is this necessary at all, and if so, is there a better way to do it?
diff --git a/includes/sitealias.inc b/includes/sitealias.inc
index 0d79454..2d6f169 100644
--- a/includes/sitealias.inc
+++ b/includes/sitealias.inc
@@ -1661,7 +1661,7 @@ function drush_sitealias_evaluate_path($path, &$additional_options, $local_only
  * Option keys used for site selection.
  */
 function drush_sitealias_site_selection_keys() {
-  return array('remote-host', 'remote-user', 'ssh-options', 'name');
+  return array('remote-host', 'remote-user', 'winrs-password', 'ssh-options', 'name', 'os');
 }
 
 
