Ben Delaney's Network Manager Script has this code within and should provide some insight on how to use it.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's