The Windows PowerShell remoting features are supported by the WS-Management protocol and the Windows Remote Management (WinRM) service that implements WS-Management in Windows. Computers running Windows 7 and later include WinRM 2.0 or later. On computers running earlier versions of Windows, you need to install WinRM 2.0 or later as appropriate and if supported. Currently, remoting is supported on Windows Vista with Service Pack 1 or later, Windows 7, Windows Server 2008, and Windows Server 2008 Release 2.

You can verify the availability of WinRM and configure a PowerShell for remoting by following these steps: 
1. Start Windows PowerShell as an administrator by right-clicking the Windows PowerShell shortcut and selecting Run As Administrator.

2. The WinRM service is confi gured for manual startup by default. You must change the startup type to Automatic and start the service on each computer you want to work with. At the PowerShell prompt, you can verify that the WinRM service is running using the following command: 
get-service winrm
The value of the Status property in the output should be “Running”.

3. To configure Windows PowerShell for remoting, type the following command: 
Enable-PSRemoting –force

In many cases, you will be able to work with remote computers in other domains. However, if the remote computer is not in a trusted domain, the remote computer might not be able to authenticate your credentials. To enable authentication, you need to add the remote computer to the list of trusted hosts for the local computer in WinRM. To do so, type: 
winrm s winrm/config/client '@{TrustedHosts="RemoteComputer"}'
Here, RemoteComputer should be the name of the remote computer, such as: 
winrm s winrm/config/client '@{TrustedHosts="CorpServer56"}'

When you are working with computers in workgroups or homegroups, you must either use HTTPS as the transport or add the remote machine to the TrustedHosts configuration settings. If you cannot connect to a remote host, verify that the service on the remote host is running and is accepting requests by running the following command on the remote host: 
winrm quickconfig
This command analyzes and configures the WinRM service.

To use Windows PowerShell remoting features, you must start Windows PowerShell as an administrator by right-clicking the Windows PowerShell shortcut and selecting Run As Administrator. When starting PowerShell from another program, such as the command prompt (cmd.exe), you must start that program as an administrator. 
Client access ps script: Invoke-Command -ComputerName RemoteComputer -ScriptBlock {dir c:\}

From the Microsoft Press book Windows PowerShell 2.0 Administrator’s Pocket Consultant by William R. Stanek.

Enable and Use Remote Commands in Windows PowerShell的更多相关文章

  1. 作为平台的Windows PowerShell(二)

    在此系列文章的前一篇,我们看到了怎样使用System.Management.Automation.PowerShell 类来在c#应用程序中运行PowerShell 命令.在那些例子中,我们创建的都是 ...

  2. 作为平台的Windows PowerShell(一)

    除了作为一种脚本语言外,Windows PowerShell被多种应用程序使用.这是因为Windows PowerShell引擎可以被托管在一个应用程序内部.这篇博文和下一篇博文将会处理在C#应用程序 ...

  3. Windows PowerShell:管理服务器

    一.概述 Cmdlets 用于服务器的管理方面主要体现在4个方面:服务.日志.进程.服务器管理器. 1.服务 •  Get-Service.查看某个服务的属性. •  New-Service.创建一个 ...

  4. Windows PowerShell 简介

    Powershell 是运行在windows机器上实现系统和应用程序管理自动化的命令行脚本环境.微软之所以将Powershell 定位为Power,并不是夸大其词,因为它完全支持对象.其可读性,易用性 ...

  5. (2)Windows PowerShell使用

    什么是PowerShell: Windows PowerShell 是一种命令行外壳程序和脚本环境,使命令行用户和脚本编写者可以利用 .NET Framework 的强大功能.PowerShell是命 ...

  6. 解决VS2015启动时Package manager console崩溃的问题 - Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope

    安装VS2015,启动以后,Package manager console崩溃,错误信息如下: Windows PowerShell updated your execution policy suc ...

  7. 用Windows PowerShell 控制管理 Microsoft Office 365

    如果想要通过PowerShell控制管理Office365,首先要安装Microsoft Online Services Sign-In Assistant 7.0,链接如下 Microsoft On ...

  8. 【SharePoint学习笔记】第2章 SharePoint Windows PowerShell 指南

    快速了解Windows PowerShell     从SharePoint 2010开始支持PowerShell,仍支持stsadm.exe工具:     可以调用.NET对象.COM对象.exe文 ...

  9. Office 365 - SharePoint 2013 Online 中使用Windows PowerShell

    1.如果想要在SharePoint Online中使用Windows PowerShell,首先需要安装SharePoint Online Management Shell(下载地址附后),如下图: ...

随机推荐

  1. fei33423 工作 职场 格言

    对老板: 1.  老板不知道你做的事情(目标设定) 2.  老板要的是规划(对上报告), 自己给自己设定 金字塔四位下的目标,各种维度.如何细化. 2.1 明确老板期望 2.2 与老板达成共识 2.3 ...

  2. Java 多线程同步生产者消费者问题-monitor

    对这个问题更深一点理解是,每一个线程都在竞争这个类的实例的monitor对象. java会为每个object对象分配一个monitor,当某个对象的同步方法(synchronized methods ...

  3. centos7安装pgsql及操作命令

    1.下载所需要的数据库版本https://yum.postgresql.org/repopackages.php 2.安装数据库版本包 yum install -y https://download. ...

  4. octave-basic

    在coursera上斯坦福的machine learning,lecturer极力推荐开源的编程环境Octave入手,所以我也下载了来试一试吧== 参考链接:http://www.linuxdiyf. ...

  5. 在Unix系统上,从源文件、目标文件、可执行文件的编译过程

    是由“编译器驱动”(compiler driver)完成的: unix> gcc -o hello hello.c 在这里,gcc的编译器驱动程序读取源文件hello.c, #include & ...

  6. centos7 安装显卡驱动方法

    方法一: 首先需要添加一个第三方的源ELRepo.这个源支持RED HAT系的Linux系统,主要是提供一些硬件的驱动程序.这个源的主页如下: http://elrepo.org/tiki/tiki- ...

  7. Linux学习-核心编译的前处理与核心功能选择

    硬件环境检视与核心功能要求 根据自己的需求来确定编译的选项 保持干净原始码: make mrproper 我们还得要处理一下核心原始码底下的残留文件才行!假设我们是第一次 编译, 但是我们不清楚到底下 ...

  8. loj2012 「SCOI2016」背单词

    -- #include <algorithm> #include <iostream> #include <cstring> #include <cstdio ...

  9. provider:命名管道提供程序,error:40 - 无法打开到SQL Server的连接 (Microsoft

    最近一直在配置服务器, 这当中最头疼的就是配置数据库 我们用的是SQL Server 数据库 2008 版本,数据库配置完之后从另一台电脑访问数据库死活连接不上,提示信息如下 " 无法连接到 ...

  10. 软件工程师应该关注的web攻击手段

    1.SQL注入------常见的安全性问题. 解决方案:前端页面需要校验用户的输入数据(限制用户输入的类型.范围.格式.长度),不能只靠后端去校验用户数据.一来可以提高后端处理的效率,二来可以提高后端 ...