Here is a code snippet to pull what you need from an sms site. I yanked it out of one of my kixforms programs and modified a little for you. It should get you started.

Personally I would be happy if all I had to do was just find the off computer's information. Our network group has blocked udp traffic from crossing subnets. That means I have to find a computer that is on and usable in the subnet of a off computer.



$WMISMSServer = fnWMIConnect($txtSMSSiteServer,,,,,"/root/sms/site_" + $txtSMSSiteCode)
IF VarType($WMISMSServer) <9
    $WMISMSServerStatus = "NoAccess"
ELSE
    $WMISMSServerStatus = "Access"
    $ComputerResourceID = fnSMSGetResourceID($Computer$WMISMSServer)
    $oClient = $WMISMSServer.ExecQuery ("Select IPAddresses, IPSubnets, MacAddresses FROM SMS_R_System WHERE ResourceID=" + $ComputerResourceID)
    FOR EACH $Client IN $oClient
        $Index = 0
        FOR EACH $IP IN $Client.IPAddresses
            IF $IP = $IPAddress
                $MACAddress = Join(Split($Client.MacAddresses($Index), ":", -1), "")
                $OffSubnet = $Client.IPSubnets($Index)
                $oSubnetMask = $WMISMSServer.ExecQuery ("Select * FROM SMS_G_System_NETWORK_ADAPTER_CONFIGURATION WHERE ResourceID=" + $ComputerResourceID)
                FOR EACH $SubnetMask IN $oSubnetMask
                    IF $SubnetMask.IPAddress = $IPAddress
                        $OffMask = $SubnetMask.IPSubnet
                    ENDIF
                NEXT
            ENDIF
            $Index = $Index + 1 ')
        NEXT '
)
    NEXT
ENDIF

_________________________
Kelly