Thursday 10 September 2015

Windows Remote Management Service


Check Remote Access
winrm get winrm/config -r:HOSTNAME

Set Trusted Hosts on a Remote Server
winrm set winrm/config/client '@{TrustedHosts="machineA,machineB"}'
This means that machineA and machineB are trusted to remove to the Remote Server.

Create a Permanent Connection to a Remote Server
New-PSSession -ComputerName HOSTNAME

Create a Permanent Connection to a Remote Server via a Port Number and a User Credential
New-PSSession -ComputerName HOSTNAME -port 81 -cred DOMAIN\USERNAME

Open Port 81 on a Server
set-item wsman:\localhost\listener\listener*\port -value 81 -force

See the Listener Details
winrm enumerate winrm/config/listener


Remove WRM Listener Configurations
winrm invoke Restore winrm/Config

Enable PowerShell Remoting
Enable-PSRemoting

Restart the Remote Manangement service
net stop winrm
net start winrm

Set Listener Port
winrm set winrm/config/Listener?Address=*+Transport=HTTP '@{Port="5985"}'