PowerShell Server vs. PowerShell Remoting
This article will explain the differences between PowerShell Server, and a remoting alternative: PowerShell Remoting via WinRM.
With PowerShell Server, you are not limited to Windows machines and you do not need WinRM or any other software besides the PowerShell Server itself and any SSH client. The “client” machine (i.e. where the commands are being sent from) can be anything: a Linux machine, a handheld device in the field, your cell phone, a Windows machine, a PHP App, etc. If you are not familiar with SSH (“Secure Shell”), it is the most commonly used protocol for remote connections between computers since it is secure and flexible.
NetCmdlets(netcmdlets.com) includes a set of cmdlets designed to connect and execute commands on PowerShell Server. While any SSH client can connect and send commands to the PowerShell Server, these cmdlets bring another level of power to the user by enabling the receipt of actual PSObjects from the PowerShell Server through the SSH connection similar to WinRM remoting. These cmdlets are the Connect-PowerShellServer, Disconnect-PowerShellServer, and Invoke-PowerShellServer cmdlets. The first two are used to create and remove SSH protected runspaces, and the latter is used to execute PowerShell commands over that connection and receive PSObjects back from the PowerShell Server.
PowerShell Remoting + WinRM
With PowerShell Remoting via WinRM, you are limited to Windows machines communicating over the web services stack.
- Both allow execution of PowerShell cmdlets on a remote Windows machine.
- Both are encrypted and secure. PowerShell server operates over an SSH (Secure Shell) connection and PowerShell Remoting works over HTTPS.
- Both require PowerShell to be installed on the remote Windows machine.
- Both require security and authentication, albeit in different ways. In both cases a security certificate is used to identify the server. In the case of PowerShell server, connecting users securely authenticate using select Windows security groups defined on the server machine. When using WinRM, by default the credentials are the currently logged in user but these can also be changed to use a remote account.
- As mentioned before, both require PowerShell on the remote machine but each requires a different “server piece”. PowerShell Remoting requires WinRM on the remote machine, and PowerShell Server requires itself to be installed on the remote machine.
- The use of PowerShell Remoting requires PowerShell and WinRM to be installed on the client machine (the machine where the commands are being sent from). There is essentially no client-side software requirement for using PowerShell Server since SSH clients exist virtually everywhere: Windows, *nix, mobile devices, Web Applications, etc. As long as it can establish an SSH connection, a client machine can connect and cmdlets can be executed.