You should be able to take the following code and save it as a VBS and run
it. It should be enough to get you started:
========================================
Set deviceFinder = CreateObject( "UPnP.UPnPDeviceFinder" )
Dim devices
Set devices =
deviceFinder.FindByType("urn:schemas-upnp-org:device:InternetGatewayDevice:1",
0)
Call ShowDevices(devices, "")
Sub ShowDevices(inDevices, inPadding)
Dim device
For each device in inDevices
Call ShowStuff(device, inPadding)
If device.HasChildren Then
Call ShowDevices(device.Children, inPadding & "..")
End If
Next
End Sub
Sub ShowWanConn(inService)
Dim retVal, emptyArgs(0), outArgs(2)
retVal = inService.InvokeAction("GetConnectionTypeInfo", emptyArgs,
outArgs)
wscript.echo "*** ConnectionType = " & outArgs(0)
retVal = inService.InvokeAction("GetNATRSIPStatus", emptyArgs, outArgs)
wscript.echo "*** NATEnabled = " & outArgs(1)
ReDim outArgs(1)
retVal = inService.InvokeAction("GetExternalIPAddress", emptyArgs, outArgs)
wscript.echo "*** ExternalIPAddress = " & outArgs(0)
End Sub
Sub ShowStuff(inDevice, inMsg)
Dim service
wscript.echo inMsg & "FriendlyName = " & inDevice.FriendlyName
wscript.echo inMsg & "Type = " & inDevice.Type
For each service in inDevice.Services
wscript.echo inMsg & "Service = " & service.ServiceTypeIdentifier
If (service.ServiceTypeIdentifier =
"urn:schemas-upnp-org:service:WANIPConnection:1") Then
ShowWanConn(service)
End If
If (service.ServiceTypeIdentifier =
"urn:schemas-upnp-org:service:WANPPPConnection:1") Then
ShowWanConn(service)
End If
Next
End Sub
================================
Regards,
=D-
Derek R. Flickinger
Interactive Homes, Inc.
"martin" <(E-Mail Removed)> wrote in message
news:1a8d901c41e56$9a2f2c20$(E-Mail Removed)...
>
> Anyone know how to detect the WAN IP address of a MN-100,
> MN-500, or MN-700 from the 192.168.2.x side of the router?
>
> I need to come up with a way to interrogate and obtain the
> address from a program.
>
> Thanks.
> Martin
>
|