zoukankan      html  css  js  c++  java
  • Enable and Use Remote Commands in Windows PowerShell

    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.
  • 相关阅读:
    星浩资本-以流程为中心
    BPM配置故事之案例13-触发消息通知
    BPM配置故事之案例12-触发另外流程
    【从零开始学BPM,Day5】报表配置及自定义功能页面开发
    BPM配置故事之案例11-操作外部数据源
    BPM配置故事之案例10-获取外部数据
    [转]页游开发中的 Python 组件与模式Presentation Transcript
    Creating a Game with CocosBuilder
    As3 Practises : use TheMiner do as3 project swf performance profile , find memory leak!
    Manual Install Cocos2d-x vc template on Windows 7
  • 原文地址:https://www.cnblogs.com/hualiu0/p/5105072.html
Copyright © 2011-2022 走看看