I don't believe you (I could be wrong of course) can determine which server it will actually use using scripts. By default, it will use the server with the lowest cost according to the site and subnet information from AD. Most of the time, it will use the same one (lowest cost) unless it couldn't be reached for some reason.