On second thought, wtsmanager.dll is much easier to use. The IP Address can be catched in a variable very easy.