I need to issue mstsc and get a status back that this command works for a series of IPs. No RDP console.
I cannot use WMI ports, just RDP 3389 to the device. Would love to use PowerShell remote commands but I read they use WMIObjects which implies using WMI ports.
I used psexec and it uses WMI ports. This worked in my lab but when I hit the real firewalls, blocked.
I've tried several methods, each hits the WMI ports or causes the RDP console to pop on the from server. I also need the event to report back connected or not found into a file for further decision making.
Terminal Services were made for interactive use, not batch mode. If you want to check if a port is accessible in PowerShell you can try to establish a TCP connection to it:
On more recent Windows versions there's also
Test-NetConnection
: