PowerShell Remoting to Windows 2012R2

Please refer to the steps below on how to PowerShell Remoting to Windows 2012R2 Server

Configuration on Windows 2012R2 Server
1. The WinRM service is running (By Default)
2. Enable PowerShell Remoting with

Enable-PSRemoting -force

Configuration on Windows 10 Machines (Non-Domain Joined)
1. Start WinRM Service

Get-Service WinRM | Start-Service
  1. Allow Windows 10 to access to All hosts
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
  1. Connect to Remote PowerShell with Credential
$UserName = "mylab\administrator"
$Password = Get-Content C:\Scripts\Aventis.txt| ConvertTo-SecureString
$Credential = new-object -typename System.Management.Automation.PSCredential -ArgumentList $UserName,$Password

New-PSSession -ComputerName -Credential $Credential

New-PSSession -ComputerName -Credential $Credential

 Id Name            ComputerName    ComputerType    State         ConfigurationName     Availability
 -- ----            ------------    ------------    -----         -----------------     ------------
  5 WinRM5   RemoteMachine   Opened        Microsoft.PowerShell     Available 
  1. Enter the PS Remote Session
Enter-PSSession 5
[]: PS C:\Users\Administrator\Documents> 

Leave a Comment