Enumerates the Dial-In configuration settings for the MyerKen Active Directory user account.
On Error Resume NextConst E_ADS_PROPERTY_NOT_FOUND = &h8000500DConst FourthOctet = 1Const ThirdOctet = 256Const SecondOctet = 65536Const FirstOctet = 16777216Set objUser = GetObject _("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")blnMsNPAllowDialin = objUser.Get("msNPAllowDialin")WScript.Echo "Remote Access Permission (Dial-in or VPN)"If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "Control access through Remote Access Policy"Err.ClearElseIf blnMsNPAllowDialin = True ThenWScript.Echo "Allow access (msNPAllowDialin)"ElseWScript.Echo "Deny access (msNPAllowDialin)"End IfEnd IfWScript.Echo VbCrarrMsNPSavedCallingStationID = objUser.GetEx("msNPSavedCallingStationID")If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "No Caller-ID specified."Err.ClearElseWScript.Echo "Verify Caller ID (msNPSavedCallingStationID): "For Each strValue in arrMsNPSavedCallingStationIDWScript.echo strValueNextobjUser.GetEx "msNPCallingStationID"If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "Calling station ID(s) specified but not assigned."Err.ClearElseWScript.echo "Calling station ID(s) assigned."End IfEnd IfWScript.Echo VbCrintMsRADIUSServiceType = objUser.Get("msRADIUSServiceType")WScript.Echo "Callback Options"If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "No Callback"Err.ClearElsestrMsRADIUSCallbackNumber = objUser.Get("msRADIUSCallbackNumber")If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "Set by caller (Routing and Remote Access Service only)"Err.ClearstrMsRASSavedCallbackNumber = objUser.Get("msRASSavedCallbackNumber")If Err.Number <> E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "Unused value of " & strMsRASSavedCallbackNumber & _" appears in the Always Callback to field."ElseErr.ClearEnd IfElseWScript.Echo "Always Callback to: " & _strMsRADIUSCallbackNumber & " (msRADIUSCallbackNumber)"End IfEnd IfWScript.Echo VbCrintMsRASSavedFramedIPAddress = objUser.Get("msRASSavedFramedIPAddress")If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "No static IP address assigned."Err.ClearElseIf sgn(intMsRASSavedFramedIPAddress) = -1 ThenintIP = intMsRASSavedFramedIPAddressWScript.StdOut.Write 256 + (int(intIP/FirstOctet)) & "."intFirstRemainder = intIP mod FirstOctetWScript.StdOut.Write 256 + (int(intFirstRemainder/SecondOctet)) & "."intSecondRemainder = intFirstRemainder mod SecondOctetWScript.StdOut.Write 256 + (int(intSecondRemainder/ThirdOctet)) & "."intThirdRemainder = intSecondRemainder mod ThirdOctetWScript.Echo 256 + (int(intThirdRemainder/FourthOctet))ElseintIP = intMsRASSavedFramedIPAddressWScript.StdOut.Write int(intIP/FirstOctet) & "."intFirstRemainder = intIP mod FirstOctetWScript.StdOut.Write int(intFirstRemainder/SecondOctet) & "."intSecondRemainder = intFirstRemainder mod SecondOctetWScript.StdOut.Write int(intSecondRemainder/ThirdOctet) & "."intThirdRemainder = intSecondRemainder mod ThirdOctetWScript.Echo int(intThirdRemainder/FourthOctet)End IfobjUser.Get "msRADIUSFramedIPAddress"If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "Static IP address specified but not assigned."Err.ClearElseWScript.Echo "Static IP Address assigned."End IfEnd IfWScript.Echo VbCrarrMsRASSavedFramedRoute = objUser.GetEx("msRASSavedFramedRoute")If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "No static Routes specified."Err.ClearElseWScript.echo "Static Routes (msRASSavedFramedRoute):"WScript.Echo vbTab & "CIDR 0.0.0.0 Metric"For Each strValue in arrMsRASSavedFramedRouteWScript.echo vbTab & strValueNextobjUser.GetEx "msRADIUSFramedRoute"If Err.Number = E_ADS_PROPERTY_NOT_FOUND ThenWScript.Echo "Static Routes specified but not assigned."Err.ClearElseWScript.echo "Static Routes assigned."End IfEnd If
This is a VB Script, this can be used by saving the file in .vbs file