Remote Access

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Stephen Jones Stephen Jones 10 months ago.

  • Author
    Posts
  • #35114
    Profile photo of Stephen Jones
    Stephen Jones
    Participant

    Hello all,

    I'm still getting up to speed on remoting to clients. Remoting is enabled and I can access clients but my questions is why can't I access clients without invoking commands or the enter-ps.... command. If I try something simple like:
    get-service -name bits -computername cpu, the commands fails. Details below:

    PS C:\windows\system32> Get-Service -Name bits -ComputerName cpu
    Get-Service : Cannot find any service with service name 'bits'.
    At line:1 char:1
    + Get-Service -Name bits -ComputerName cpu
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (bits:String) [Get-Service], ServiceCommandException
    + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand

    PS C:\windows\system32> Enter-PSSession cpu

    [cpu]: PS C:\Users\admin\Documents> $psversionable

    [cpu]: PS C:\Users\admin\Documents> $PSVersionTable

    Name Value
    —- —–
    PSVersion 3.0
    WSManStackVersion 3.0
    SerializationVersion 1.1.0.1
    CLRVersion 4.0.30319.34209
    BuildVersion 6.2.9200.16398
    PSCompatibleVersions {1.0, 2.0, 3.0}
    PSRemotingProtocolVersion 2.2

    [cpu]: PS C:\Users\admin\Documents> get-service -name bits

    Status Name DisplayName
    —— —- ———–
    Running bits Background Intelligent Transfer Ser...

    cpu]: PS C:\Users\admin\Documents> exit

    PS C:\windows\system32> Invoke-Command -ComputerName cpu {get-service -name bits}

    Status Name DisplayName PSComputerName
    —— —- ———– ————–
    Running bits Background Intelligent Transfer Ser... cpu

    All machines are domain joined and I'm running the commands as administrator. Where did I go wrong?

  • #35115
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Get-Service doesn't use Remoting. It uses DCOM, and I believe relies on the Remote Registry Service. Lots of older commands, with their own -ComputerName parameter, use their own remote connectivity, not necessarily Remoting.

  • #35128
    Profile photo of Stephen Jones
    Stephen Jones
    Participant

    Thanks for the quick response Don, that clarifies things. I feel like I'm missing something every time I watch a video and can't replicate the results on my end. I really appreciate your help and the support of this forum!

You must be logged in to reply to this topic.