Remote Access

Welcome Forums General PowerShell Q&A Remote Access

This topic contains 2 replies, has 2 voices, and was last updated by

3 years, 5 months ago.

  • Author
  • #35114

    Topics: 4
    Replies: 4
    Points: 0
    Rank: Member

    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
    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

    Topics: 13
    Replies: 4872
    Points: 1,842
    Helping HandTeam Member
    Rank: Community Hero

    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

    Topics: 4
    Replies: 4
    Points: 0
    Rank: Member

    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!

The topic ‘Remote Access’ is closed to new replies.