4string 0 Newbie Poster

Hi,
I'm trying to use Perl script to call WMI interface, but I found out the WMI ports are random, how can I restrict the range of TCP Ports(Actually, I wanna keep the same port access)? Is there any way to make sure this is always allowed? If anyone can offer any script sample would be great, thank a lot.