Run local cmdlets on remote machines

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

  • Author
    Posts
  • #67101

    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

    MK
    Participant

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

    • #67140

      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

    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.