1

Would someone please confirm what type of remoting used by -ComputerName parameter of Powershell cmdlets. E.g. Get-Service, Get-EventLog. I am trying to get some information remotely. I tried Get-CimInstance, it didn't work. I tried Get-WmiObject, it didn't work either. Then just for check, I tried Get-Service, it worked. Just curious about to know what remoting is being used in -ComputerName parameter of Get-Service. Also if there any way to check what remoting was/being used when I ran or running "Get-Service -ComputerName Bits" cmdlet.

Thanks Jatinder Pal Singh

JPS
  • 23
  • 3
  • Documentation says it only works on Windows. You need an account on both local and remote machines for it to work since it using a Windows Credential. To make sure you have access to the machine I would use File Explorer and see if you can access the machine \\ComputerName If you are an Admin on both local and remote machines you should see all the drives on the machine. – jdweng Aug 21 '23 at 11:59
  • In short: The `-ComputerName` parameters supported on individual cmdlets such as `Get-Service` are supported in _Windows PowerShell only_, and are based on the obsolete .NET Remoting technology. In _PowerShell (Core) 7+_, only the dedicated remoting cmdlets (`Invoke-Command`, `Enter-PSSession`) and the CIM cmdlets (e.g. `Get-CimInstance`) have `-ComputerName` parameters and use PowerShell's WinRM-based remoting, which is firewall-friendly. PowerShell remoting is set up by default in server editions starting with Windows Server 2012. See the linked duplicate for details. – mklement0 Aug 21 '23 at 13:04
  • 1
    Thanks @mklement0 for your answer. I was looking for this :) – JPS Aug 22 '23 at 13:33
  • Glad to hear it helped, @JPS. – mklement0 Aug 22 '23 at 13:38

0 Answers0