Run local cmdlets on remote machines

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Richard Siddaway Richard Siddaway 3 months ago.

  • Author
    Posts
  • #67101
    Profile photo of SB
    SB
    Participant

    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
    Profile photo of MK
    MK
    Participant

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

    • #67140
      Profile photo of SB
      SB
      Participant

      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
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

    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.

You must be logged in to reply to this topic.