Run local cmdlets on remote machines

Welcome Forums General PowerShell Q&A Run local cmdlets on remote machines

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

 
Participant
1 year, 7 months ago.

  • Author
    Posts
  • #67101
    SB

    Participant
    Points: 0
    Rank: Member

    I installed WMF 5.1, and I want to run some cmdlets (ex: Get-localuser), but I want to run it on servers that don't have any of those cmdlets because they are on older versions of PowerShell. Is that possible? The Servers are 2012R2

  • #67107
    MK

    Participant
    Points: 1
    Rank: Member

    No, you cant use Get-localuser, try Get-WmiObject -Class win32_useraccount

    • #67140
      SB

      Participant
      Points: 0
      Rank: Member

      Thanks for the response. Just to be sure, is it possible at all to use cmdlets that are available on on one machine against a remote machine, if that remote machine doesn't have the same version of Powershell, but the OS on both machines are the same?

  • #67234

    Participant
    Points: 0
    Rank: Member

    Any cmdlet you call using a remoting session OR through Invoke-Command must exist on the remote machine. You CAN'T use a local cmdlet in a remoting session (or Invoke-Command) against a remote machine.

The topic ‘Run local cmdlets on remote machines’ is closed to new replies.