How to Fix Powershell Remoting and WinRM with SPN's

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 16

  • @BigBadJohn365
    @BigBadJohn365 5 ปีที่แล้ว

    From the source computer, can this be done on a machine using Powershell that is not a Domain joined computer (Workgroup Standalone Machine) or does Powershell need to be running/installed under a Windows Server for this to work? My end goal is to use Powershell to remotely connect to two non-domain joined computers & run commands in the background to the destination computer.
    [10.228.253.X] Connecting to remote server 10.228.253.X failed with the following error message : The WinRM client
    cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not
    joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts
    configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not
    be authenticated. You can get more information about that by running the following command: winrm help config. For
    more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo : OpenError: (10.228.253.X:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : ServerNotTrusted,PSSessionStateBroken

    • @TipsForITPros
      @TipsForITPros  5 ปีที่แล้ว

      OK in your example since you are working in a workgroup you need to enable and trust.
      The two commands below should allow you to do what you want but you could replace the * with a server name.
      Enable-PSRemoting -force
      Set-Item WSMan:localhost\client\trustedhosts -value *

  • @torben.iisager
    @torben.iisager หลายเดือนก่อน

    I know it's an old post, but still nice work, thanks

  • @theAboodNet
    @theAboodNet 4 ปีที่แล้ว

    Actually winRM runs under Network Service account not local service account.

    • @TipsForITPros
      @TipsForITPros  4 ปีที่แล้ว +1

      Do you want to get into the technicalities than the local service account and the network service account is still the computer account there just different permissions of the same thing.

  • @alejandroparrello6493
    @alejandroparrello6493 2 ปีที่แล้ว

    Hi mr tips! thx for the video!
    could you explain how can I block the use of winrm using windows firewall, i just want to allow 1 or 2 ip/host to manage other PCs on the domian network. i hope you understand what i mean 🤞😉 Regards from Argentina 👋

    • @TipsForITPros
      @TipsForITPros  2 ปีที่แล้ว

      Ok that’s quite an easy one winrm uses port 5985 and 5986 so a windows firewall rule is easiest way to do that.
      So something like
      Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress 192.168.0.10,172.16.1.20

    • @alejandroparrello6493
      @alejandroparrello6493 2 ปีที่แล้ว

      @@TipsForITPros thank you very much! Could i email you? 😅✌️

  • @anthonya417
    @anthonya417 5 ปีที่แล้ว +2

    Super usefull, keep going, thanks

    • @TipsForITPros
      @TipsForITPros  5 ปีที่แล้ว

      Thanks, and I will

    • @gregc1203
      @gregc1203 4 ปีที่แล้ว

      What is the command used to configure a machine to receive remote administrative requests?
      Thanks.

    • @TipsForITPros
      @TipsForITPros  4 ปีที่แล้ว

      @@gregc1203 You are talking about configuring winrm, this is normally not needed if the server is on a domain as the default GPO enables it.
      in a workgroup you would need to run it
      Enable-PSRemoting
      New-WSManInstance - ResourceURI winrm/config/Listener -SelectorSet @{Transport=HTTPS} -ValueSet @{Hostname="HOST";CertificateThumbprint="XXXXXXXXXX"}

  • @mohitjangir
    @mohitjangir 4 ปีที่แล้ว

    winrm protocol support in win like ssh in win, install winrm lib using python pip installer, then install powershell, use some script in powershell to enable winrm in win in ansible either manually enable, for enabling in inv write conn type winrm pass admin host

    • @TipsForITPros
      @TipsForITPros  4 ปีที่แล้ว +1

      That's not solving the issue that's a workaround.

  • @milevyo
    @milevyo 2 ปีที่แล้ว +1

    live is cruel 👾, from 5994 views for so far, only 38 likes!!!. otherwise, good job man. 👍 ⭐⭐⭐⭐⭐

    • @TipsForITPros
      @TipsForITPros  2 ปีที่แล้ว +1

      Well people care about the solution, not from the place they get it ;)