Does anyone know how to query Microsoft RPC from linux in order to find out the port number of those Microsoft services that keep changing ports?

I really want to test some services but the port numbers are dynamic and they change. I know I can fix some services ports via the Windows registry but I'd really like to be able to query the Microsoft RPC service and find out what port a service is listening on from the linux command line.

Is there any good program/way of doing this?