g707
02-09-2004, 12:27 PM
Not sure if this is the correct forum for this question, but no harm in posting:
I need to list the static IPs for our RAS user into a web page, (Active Directory 2000)
I determined the ADSI attribute as:
msRASSavedFramedIPAddress
Problem is the result is an integer value, maybe hex? I need to figure out how to convert and display the value as most normal people at used to seeing: x.x.x.x (ex. 192.168.0.1)
Any ideas?
Using ASP, ADSI, VBSCRIPT
Here the sample code I have so far, taken from technet, any help to display as web page would be greatly appreicated.
intMsRASSavedFramedIPAddress = objUser.Get("msRASSavedFramedIPAddress")
If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
WScript.Echo "No static IP address assigned."
Err.Clear
Else
hexMsRASSavedFramedIPAddress = Hex(intMsRASSavedFramedIPAddress)
WScript.StdOut.Write "IP Address in Hex (msRASSavedFramedIPAddress): "
For i = 1 to 8 Step 2
If i < 6 Then
WScript.StdOut.Write Mid(hexMsRASSavedFramedIPAddress,i,2) & "."
Else
WScript.Echo Mid(hexMsRASSavedFramedIPAddress,i,2)
End If
Next
objUser.Get "msRADIUSFramedIPAddress"
If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
WScript.Echo "Static IP address specified but not assigned."
Err.Clear
Else
WScript.Echo "Static IP Address assigned."
End If
End If
*******
* g707 *
*******<P ID="edit"><FONT class="small">Edited by g707 on 02/09/04 12:43.</FONT></P>
I need to list the static IPs for our RAS user into a web page, (Active Directory 2000)
I determined the ADSI attribute as:
msRASSavedFramedIPAddress
Problem is the result is an integer value, maybe hex? I need to figure out how to convert and display the value as most normal people at used to seeing: x.x.x.x (ex. 192.168.0.1)
Any ideas?
Using ASP, ADSI, VBSCRIPT
Here the sample code I have so far, taken from technet, any help to display as web page would be greatly appreicated.
intMsRASSavedFramedIPAddress = objUser.Get("msRASSavedFramedIPAddress")
If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
WScript.Echo "No static IP address assigned."
Err.Clear
Else
hexMsRASSavedFramedIPAddress = Hex(intMsRASSavedFramedIPAddress)
WScript.StdOut.Write "IP Address in Hex (msRASSavedFramedIPAddress): "
For i = 1 to 8 Step 2
If i < 6 Then
WScript.StdOut.Write Mid(hexMsRASSavedFramedIPAddress,i,2) & "."
Else
WScript.Echo Mid(hexMsRASSavedFramedIPAddress,i,2)
End If
Next
objUser.Get "msRADIUSFramedIPAddress"
If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
WScript.Echo "Static IP address specified but not assigned."
Err.Clear
Else
WScript.Echo "Static IP Address assigned."
End If
End If
*******
* g707 *
*******<P ID="edit"><FONT class="small">Edited by g707 on 02/09/04 12:43.</FONT></P>