none
Invoke-Command on a container RRS feed

  • Question

  • I am unable to run Invoke-Command on a container. I am running the TP4 build.


    I have done the following:

    1. Enabled AllowUnencrypted and set TrustedHosts to * in wsman::Localhost\client in the container host
    2. Created a local user in the container and added them to the administrator group

    Calling the command:

    Invoke-Command -ComputerName 172.16.0.2 -ScriptBlock {Dir} -Credentisl (Get-Credential)

    returns the error Access Denied

    The immediate conclusion is that the credentials are incorrect but I have verified in the container that the Microsoft-Windows-Security-Auditing provider that the account was successfully logged on.

    There are two error events:

    ProviderName: Microsoft-Windows-DistributedCOM
    Unable to start a DCOM Server: {9ACF41ED-D457-4CC1-925B-AHSGDTEBF097}. The error: "5" Happened while starting this command: c:\Windows\System32\wsmprovhost.exe -Embedding

    ProviderName: Microsoft-Windows-WinRM
    The WSMan service could not launch a host process to process the given request. Make sure the WSMan provider host server and proxy are properly registered. Error code 5

    Error Code 5 once again does tend to point to an ACCESS_DENIED error


    Is anyone able to run invoke-command on a container?
    Friday, November 20, 2015 5:29 PM

Answers

  • Hi Shawn,

    you need to run invoke-command -containername container { command } (optional -runasadministrator)

    Note: You need to be on the container host to do this also

    Thursday, December 3, 2015 8:01 PM