​​​​To access a VM from a Remote Server you must follow the next steps :

1. Download psexec

2. Run CMD with Administrative privileges

3. Execute the following command :

psexec \\ 10.x.x.x cmd -u "USERNAME" -p "PASSWORD"

4. If successfully connected then it shows the following screen

Then you can start run the following commands.

Verify RDP is enabled
wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting get servername,allowtsconnections

 

This will both enable RDP and set the firewall exception
wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL SetAllowTSConnections 1,1

 

Check Windows Firewall Current State
netsh advfirewall show currentprofile state

 

Disable the Windows Firewall
netsh advfirewall set allprofiles state off

 

Enable the Windows Firewall
netsh advfirewall set allprofiles state on
Share This