Accessing Windows Remotely via PowerShell Remoting with AD
-
PowerShell Remoting brings the same type of power found in SSH on other platforms to Windows. In order to use it, we have to first enable it on our target (or client) machine:
Client Machine - Enable PowerShell Remoting
All that we need to do is run this handy automatic PowerShell Remoting configuration command as the administrator from the command line of the target or client Windows machine (or course you can enable this via GPO or other means, as well.) By default, PSRemoting should already be enabled on Windows Server 2012 and later, but in case it is not or has become disabled, this will enable it.
Enable-PSRemoting
Accessing Machine
Now that PSRemoting has been enabled, we simply need to access the machine from PowerShell. We can use the hostname or IP address here. This only works in this simple form when we are working in an Active Directory environment as this enables the secure channel and authentication mechanisms. PSRemoting without AD is more complex.
Enter-PSSession --computername
The hostname of the computer must be used, an IP Address is not supported by Kerberos and so cannot be used with the simple form of the command shown here.
Reference:
https://technet.microsoft.com/en-us/magazine/gg981683.aspx
https://technet.microsoft.com/en-us/library/hh849694.aspx