PowerCLI

 View Only
  • 1.  Unable to run Invoke command

    Posted Apr 28, 2017 05:47 AM

    Why i am not able to run this cmdlet ?

    I want to run this command into remote machine.

    Invoke-Command -ComputerName "IP" -Credential domain\username -ScriptBlock { Get-Item }

    Error:

    [<IP>] Connecting to remote server <IP> failed with the

    following error message : WinRM cannot complete the operation. Verify that the

    specified computer name is valid, that the computer is accessible over the

    network, and that a firewall exception for the WinRM service is enabled and

    allows access from this computer. By default, the WinRM firewall exception for

    public profiles limits access to remote computers within the same local subnet.

    For more information, see the about_Remote_Troubleshooting Help topic.

        + CategoryInfo          : OpenError: (<IP>:String) [], PSRemotingT

       ransportException

        + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken



  • 2.  RE: Unable to run Invoke command

    Posted Apr 28, 2017 06:16 AM

    Like the error message states, this can be due to multiple reasons.

    Did you do the diagnostic steps documented in about_Remote_Troubleshooting?



  • 3.  RE: Unable to run Invoke command

    Posted Apr 28, 2017 10:44 AM

    Thanks for the reply.

    No, i haven't.

    Is there any specific one which i need to configure ?

    Can you please suggest because I am new in PS.

    Ques: I need to run the invoke command to multiple remote machine.



  • 4.  RE: Unable to run Invoke command

    Posted Apr 28, 2017 10:59 AM

    I would start by running Enable-PSRemoting on the remote machine.

    That does all the required settings on the remote machine.

    If that doesn't fix the issue, continue with the other steps in the document.