

OR IF: you know what the application is and what commands it will accept you can query every listening port on the remote system using telnet, however Telnet cannot be scripted, so you woudl need to download a 3rd party tool to accomplish that bit. IF: you have a User name and password for the system, and IF the application you are looking for stores it't port in the registry, you can query the remote registry to check the setting using NT Commands and regardless you would need to have a user name and password on the system to authenticate with in order to do this.


WMI (and therefore WMIC) Cannot show you active ports and the processes running them it's intentions are for system management. Netstat will ONLY show LOCALLY open ports. Since you do not know what port it will be on, this will not be possible.
