Invok-Command on localhost not working — by Limitless Technology on Microsoft Q&A
A user got Access denied running Invoke-Command against localhost even though WinRM was started. The answer explains Invoke-Command needs PowerShell remoting enabled even for the local machine, and suggests setting WinRM to Automatic, starting it and enabling remoting. The answer writes the cmdlet as EnablePSRemoting; the real name is Enable-PSRemoting. Enabling remoting opens a WinRM listener, so only do it where you need it.
Quick steps
- Set-Service winrm -StartupType Automatic
- Start-Service winrm
- Enable-PSRemoting -Force
Paraphrased from the source. Menus can differ by version, so check the original for full details.
Source: Invok-Command on localhost not working by Limitless Technology on Microsoft Q&A. Licence: Link only (©).
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me