Sign in to follow this  
Followers 0
LiHang

SDO failure in Autoit

7 posts in this topic

Hi,

Need help for SDO object. I searched the whole forum and cannot find any existing topics. (If I incorrectly used the search function here, pls help me :idea: )

Recently I'm working on Autoit to manage our IAS server (Microsoft Internet Authentication Service). There's some MS technical documents about the interface to this service, named SDO (Server Data Objects). With the sample VBScript, it could work.

Since we need GUI for such tools, I tried to migrate the vbscript to Autoit, but always failed. :)

Below is the sample vbscript from MS:

Option Explicit

Const DATA_STORE_LOCAL = 0
Const PROPERTY_SDO_NAME = 2

Const PROPERTY_IAS_POLICIES_COLLECTION = 1025
Const PROPERTY_IAS_PROFILES_COLLECTION = 1026

Const PROPERTY_IAS_PROTOCOLS_COLLECTION = 1027

Const PROPERTY_RADIUS_CLIENTS_COLLECTION = 1029

Const PROPERTY_CLIENT_REQUIRE_SIGNATURE = 1024 
Const PROPERTY_CLIENT_SHARED_SECRET = 1026 
Const PROPERTY_CLIENT_NAS_MANUFACTURER = 1027 
Const PROPERTY_CLIENT_ADDRESS = 1028 


Const PROPERTY_PROFILE_ATTRIBUTES_COLLECTION = 1024
Const PROPERTY_ATTRIBUTE_ID = 1024
Const PROPERTY_ATTRIBUTE_DISPLAY_NAME = 1035

Const PROPERTY_POLICY_CONSTRAINT = 1024
Const PROPERTY_POLICY_MERIT = 1025 
Const PROPERTY_POLICY_PROFILE_NAME = 1028 
Const PROPERTY_POLICY_ACTION = 1029
Const PROPERTY_POLICY_CONDITIONS_COLLECTION = 1030

Const PROPERTY_CONDITION_TEXT = 1024


Dim sdoMachine, sdoServiceSDO
Dim sdoCollProfiles, sdoCollProtocols, sdoCollClients, sdoCollPolicies
Dim sdoCollAttributes, sdoCollConditions
Dim sdoRADIUS
Dim vtProfile, vtProtocol, vtClient, vtPolicy, vtAttribute, vtCondition
Dim ServerName

ServerName="server1"

Set sdoMachine = CreateObject("IAS.SdoMachine")
sdoMachine.Attach ServerName
Set sdoServiceSDO = sdoMachine.GetServiceSDO(DATA_STORE_LOCAL, "IAS")


'
' List Clients
'
Set sdoCollProtocols = sdoServiceSDO.GetProperty(PROPERTY_IAS_PROTOCOLS_COLLECTION)
Set sdoRADIUS = sdoCollProtocols.Item("Microsoft Radius Protocol")
Set sdoCollClients = sdoRADIUS.GetProperty(PROPERTY_RADIUS_CLIENTS_COLLECTION)

WScript.Echo "On Server " & Chr(34) & ServerName & Chr(34) & " found " & sdoCollClients.Count & " client(s)."
For Each vtClient in sdoCollClients
    WScript.Echo "Client Friendly Name " & Chr(34) & vtClient.GetProperty(PROPERTY_SDO_NAME) & Chr(34) &vbCRLF & "Shared Secret " & Chr(34) & vtClient.GetProperty(PROPERTY_CLIENT_SHARED_SECRET) & Chr(34) & vbCRLF & "IP Address" & Chr(34) & vtClient.GetProperty(PROPERTY_CLIENT_ADDRESS) & Chr(34)
Next 'vtClient

And below is the autoit script (I added a lot constants in it)

Opt("MustDeclareVars", 1)
#region Define IAS Constants
;ATTRIBUTEID
Const $ATTRIBUTE_UNDEFINED  = 0
Const $ATTRIBUTE_MIN_VALUE  = 1
Const $RADIUS_ATTRIBUTE_USER_NAME   = $ATTRIBUTE_MIN_VALUE
Const $RADIUS_ATTRIBUTE_USER_PASSWORD   = $RADIUS_ATTRIBUTE_USER_NAME + 1
Const $RADIUS_ATTRIBUTE_CHAP_PASSWORD   = $RADIUS_ATTRIBUTE_USER_PASSWORD + 1
Const $RADIUS_ATTRIBUTE_NAS_IP_ADDRESS  = $RADIUS_ATTRIBUTE_CHAP_PASSWORD + 1
Const $RADIUS_ATTRIBUTE_NAS_PORT    = $RADIUS_ATTRIBUTE_NAS_IP_ADDRESS + 1
Const $RADIUS_ATTRIBUTE_SERVICE_TYPE    = $RADIUS_ATTRIBUTE_NAS_PORT + 1
Const $RADIUS_ATTRIBUTE_FRAMED_PROTOCOL = $RADIUS_ATTRIBUTE_SERVICE_TYPE + 1
Const $RADIUS_ATTRIBUTE_FRAMED_IP_ADDRESS   = $RADIUS_ATTRIBUTE_FRAMED_PROTOCOL + 1
Const $RADIUS_ATTRIBUTE_FRAMED_IP_NETMASK   = $RADIUS_ATTRIBUTE_FRAMED_IP_ADDRESS + 1
Const $RADIUS_ATTRIBUTE_FRAMED_ROUTING  = $RADIUS_ATTRIBUTE_FRAMED_IP_NETMASK + 1
Const $RADIUS_ATTRIBUTE_FILTER_ID   = $RADIUS_ATTRIBUTE_FRAMED_ROUTING + 1
Const $RADIUS_ATTRIBUTE_FRAMED_MTU  = $RADIUS_ATTRIBUTE_FILTER_ID + 1
Const $RADIUS_ATTRIBUTE_FRAMED_COMPRESSION  = $RADIUS_ATTRIBUTE_FRAMED_MTU + 1
Const $RADIUS_ATTRIBUTE_LOGIN_IP_HOST   = $RADIUS_ATTRIBUTE_FRAMED_COMPRESSION + 1
Const $RADIUS_ATTRIBUTE_LOGIN_SERVICE   = $RADIUS_ATTRIBUTE_LOGIN_IP_HOST + 1
Const $RADIUS_ATTRIBUTE_LOGIN_TCP_PORT  = $RADIUS_ATTRIBUTE_LOGIN_SERVICE + 1
Const $RADIUS_ATTRIBUTE_UNASSIGNED1 = $RADIUS_ATTRIBUTE_LOGIN_TCP_PORT + 1
Const $RADIUS_ATTRIBUTE_REPLY_MESSAGE   = $RADIUS_ATTRIBUTE_UNASSIGNED1 + 1
Const $RADIUS_ATTRIBUTE_CALLBACK_NUMBER = $RADIUS_ATTRIBUTE_REPLY_MESSAGE + 1
Const $RADIUS_ATTRIBUTE_CALLBACK_ID = $RADIUS_ATTRIBUTE_CALLBACK_NUMBER + 1
Const $RADIUS_ATTRIBUTE_UNASSIGNED2 = $RADIUS_ATTRIBUTE_CALLBACK_ID + 1
Const $RADIUS_ATTRIBUTE_FRAMED_ROUTE    = $RADIUS_ATTRIBUTE_UNASSIGNED2 + 1
Const $RADIUS_ATTRIBUTE_FRAMED_IPX_NETWORK  = $RADIUS_ATTRIBUTE_FRAMED_ROUTE + 1
Const $RADIUS_ATTRIBUTE_STATE   = $RADIUS_ATTRIBUTE_FRAMED_IPX_NETWORK + 1
Const $RADIUS_ATTRIBUTE_CLASS   = $RADIUS_ATTRIBUTE_STATE + 1
Const $RADIUS_ATTRIBUTE_VENDOR_SPECIFIC = $RADIUS_ATTRIBUTE_CLASS + 1
Const $RADIUS_ATTRIBUTE_SESSION_TIMEOUT = $RADIUS_ATTRIBUTE_VENDOR_SPECIFIC + 1
Const $RADIUS_ATTRIBUTE_IDLE_TIMEOUT    = $RADIUS_ATTRIBUTE_SESSION_TIMEOUT + 1
Const $RADIUS_ATTRIBUTE_TERMINATION_ACTION  = $RADIUS_ATTRIBUTE_IDLE_TIMEOUT + 1
Const $RADIUS_ATTRIBUTE_CALLED_STATION_ID   = $RADIUS_ATTRIBUTE_TERMINATION_ACTION + 1
Const $RADIUS_ATTRIBUTE_CALLING_STATION_ID  = $RADIUS_ATTRIBUTE_CALLED_STATION_ID + 1
Const $RADIUS_ATTRIBUTE_NAS_IDENTIFIER  = $RADIUS_ATTRIBUTE_CALLING_STATION_ID + 1
Const $RADIUS_ATTRIBUTE_PROXY_STATE = $RADIUS_ATTRIBUTE_NAS_IDENTIFIER + 1
Const $RADIUS_ATTRIBUTE_LOGIN_LAT_SERVICE   = $RADIUS_ATTRIBUTE_PROXY_STATE + 1
Const $RADIUS_ATTRIBUTE_LOGIN_LAT_NODE  = $RADIUS_ATTRIBUTE_LOGIN_LAT_SERVICE + 1
Const $RADIUS_ATTRIBUTE_LOGIN_LAT_GROUP = $RADIUS_ATTRIBUTE_LOGIN_LAT_NODE + 1
Const $RADIUS_ATTRIBUTE_FRAMED_APPLETALK_LINK   = $RADIUS_ATTRIBUTE_LOGIN_LAT_GROUP + 1
Const $RADIUS_ATTRIBUTE_FRAMED_APPLETALK_NET    = $RADIUS_ATTRIBUTE_FRAMED_APPLETALK_LINK + 1
Const $RADIUS_ATTRIBUTE_FRAMED_APPLETALK_ZONE   = $RADIUS_ATTRIBUTE_FRAMED_APPLETALK_NET + 1
Const $RADIUS_ATTRIBUTE_ACCT_STATUS_TYPE    = $RADIUS_ATTRIBUTE_FRAMED_APPLETALK_ZONE + 1
Const $RADIUS_ATTRIBUTE_ACCT_DELAY_TIME = $RADIUS_ATTRIBUTE_ACCT_STATUS_TYPE + 1
Const $RADIUS_ATTRIBUTE_ACCT_INPUT_OCTETS   = $RADIUS_ATTRIBUTE_ACCT_DELAY_TIME + 1
Const $RADIUS_ATTRIBUTE_ACCT_OUTPUT_OCTETS  = $RADIUS_ATTRIBUTE_ACCT_INPUT_OCTETS + 1
Const $RADIUS_ATTRIBUTE_ACCT_SESSION_ID = $RADIUS_ATTRIBUTE_ACCT_OUTPUT_OCTETS + 1
Const $RADIUS_ATTRIBUTE_ACCT_AUTHENTIC  = $RADIUS_ATTRIBUTE_ACCT_SESSION_ID + 1
Const $RADIUS_ATTRIBUTE_ACCT_SESSION_TIME   = $RADIUS_ATTRIBUTE_ACCT_AUTHENTIC + 1
Const $RADIUS_ATTRIBUTE_ACCT_INPUT_PACKETS  = $RADIUS_ATTRIBUTE_ACCT_SESSION_TIME + 1
Const $RADIUS_ATTRIBUTE_ACCT_OUTPUT_PACKETS = $RADIUS_ATTRIBUTE_ACCT_INPUT_PACKETS + 1
Const $RADIUS_ATTRIBUTE_ACCT_TERMINATE_CAUSE    = $RADIUS_ATTRIBUTE_ACCT_OUTPUT_PACKETS + 1
Const $RADIUS_ATTRIBUTE_ACCT_MULTI_SSN_ID   = $RADIUS_ATTRIBUTE_ACCT_TERMINATE_CAUSE + 1
Const $RADIUS_ATTRIBUTE_ACCT_LINK_COUNT = $RADIUS_ATTRIBUTE_ACCT_MULTI_SSN_ID + 1
Const $RADIUS_ATTRIBUTE_CHAP_CHALLENGE  = 60
Const $RADIUS_ATTRIBUTE_NAS_PORT_TYPE   = $RADIUS_ATTRIBUTE_CHAP_CHALLENGE + 1
Const $RADIUS_ATTRIBUTE_PORT_LIMIT  = $RADIUS_ATTRIBUTE_NAS_PORT_TYPE + 1
Const $RADIUS_ATTRIBUTE_LOGIN_LAT_PORT  = $RADIUS_ATTRIBUTE_PORT_LIMIT + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_TYPE = $RADIUS_ATTRIBUTE_LOGIN_LAT_PORT + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_MEDIUM_TYPE  = $RADIUS_ATTRIBUTE_TUNNEL_TYPE + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_CLIENT_ENDPT = $RADIUS_ATTRIBUTE_TUNNEL_MEDIUM_TYPE + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_SERVER_ENDPT = $RADIUS_ATTRIBUTE_TUNNEL_CLIENT_ENDPT + 1
Const $RADIUS_ATTRIBUTE_ACCT_TUNNEL_CONN    = $RADIUS_ATTRIBUTE_TUNNEL_SERVER_ENDPT + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_PASSWORD = $RADIUS_ATTRIBUTE_ACCT_TUNNEL_CONN + 1
Const $RADIUS_ATTRIBUTE_ARAP_PASSWORD   = $RADIUS_ATTRIBUTE_TUNNEL_PASSWORD + 1
Const $RADIUS_ATTRIBUTE_ARAP_FEATURES   = $RADIUS_ATTRIBUTE_ARAP_PASSWORD + 1
Const $RADIUS_ATTRIBUTE_ARAP_ZONE_ACCESS    = $RADIUS_ATTRIBUTE_ARAP_FEATURES + 1
Const $RADIUS_ATTRIBUTE_ARAP_SECURITY   = $RADIUS_ATTRIBUTE_ARAP_ZONE_ACCESS + 1
Const $RADIUS_ATTRIBUTE_ARAP_SECURITY_DATA  = $RADIUS_ATTRIBUTE_ARAP_SECURITY + 1
Const $RADIUS_ATTRIBUTE_PASSWORD_RETRY  = $RADIUS_ATTRIBUTE_ARAP_SECURITY_DATA + 1
Const $RADIUS_ATTRIBUTE_PROMPT  = 76
Const $RADIUS_ATTRIBUTE_CONNECT_INFO    = $RADIUS_ATTRIBUTE_PROMPT + 1
Const $RADIUS_ATTRIBUTE_CONFIGURATION_TOKEN = $RADIUS_ATTRIBUTE_CONNECT_INFO + 1
Const $RADIUS_ATTRIBUTE_EAP_MESSAGE = $RADIUS_ATTRIBUTE_CONFIGURATION_TOKEN + 1
Const $RADIUS_ATTRIBUTE_SIGNATURE   = $RADIUS_ATTRIBUTE_EAP_MESSAGE + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_PVT_GROUP_ID = $RADIUS_ATTRIBUTE_SIGNATURE + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_ASSIGNMENT_ID    = $RADIUS_ATTRIBUTE_TUNNEL_PVT_GROUP_ID + 1
Const $RADIUS_ATTRIBUTE_TUNNEL_PREFERENCE   = $RADIUS_ATTRIBUTE_TUNNEL_ASSIGNMENT_ID + 1
Const $RADIUS_ATTRIBUTE_ARAP_CHALLENGE_RESPONSE = $RADIUS_ATTRIBUTE_TUNNEL_PREFERENCE + 1
Const $RADIUS_ATTRIBUTE_ACCT_INTERIM_INTERVAL   = $RADIUS_ATTRIBUTE_ARAP_CHALLENGE_RESPONSE + 1
Const $IAS_ATTRIBUTE_SAVED_RADIUS_FRAMED_IP_ADDRESS = 0x1000
Const $IAS_ATTRIBUTE_SAVED_RADIUS_CALLBACK_NUMBER   = $IAS_ATTRIBUTE_SAVED_RADIUS_FRAMED_IP_ADDRESS + 1
Const $IAS_ATTRIBUTE_NP_CALLING_STATION_ID  = $IAS_ATTRIBUTE_SAVED_RADIUS_CALLBACK_NUMBER + 1
Const $IAS_ATTRIBUTE_SAVED_NP_CALLING_STATION_ID    = $IAS_ATTRIBUTE_NP_CALLING_STATION_ID + 1
Const $IAS_ATTRIBUTE_SAVED_RADIUS_FRAMED_ROUTE  = $IAS_ATTRIBUTE_SAVED_NP_CALLING_STATION_ID + 1
Const $IAS_ATTRIBUTE_IGNORE_USER_DIALIN_PROPERTIES  = $IAS_ATTRIBUTE_SAVED_RADIUS_FRAMED_ROUTE + 1
Const $IAS_ATTRIBUTE_NP_TIME_OF_DAY = $IAS_ATTRIBUTE_IGNORE_USER_DIALIN_PROPERTIES + 1
Const $IAS_ATTRIBUTE_NP_CALLED_STATION_ID   = $IAS_ATTRIBUTE_NP_TIME_OF_DAY + 1
Const $IAS_ATTRIBUTE_NP_ALLOWED_PORT_TYPES  = $IAS_ATTRIBUTE_NP_CALLED_STATION_ID + 1
Const $IAS_ATTRIBUTE_NP_AUTHENTICATION_TYPE = $IAS_ATTRIBUTE_NP_ALLOWED_PORT_TYPES + 1
Const $IAS_ATTRIBUTE_NP_ALLOWED_EAP_TYPE    = $IAS_ATTRIBUTE_NP_AUTHENTICATION_TYPE + 1
Const $IAS_ATTRIBUTE_SHARED_SECRET  = $IAS_ATTRIBUTE_NP_ALLOWED_EAP_TYPE + 1
Const $IAS_ATTRIBUTE_CLIENT_IP_ADDRESS  = $IAS_ATTRIBUTE_SHARED_SECRET + 1
Const $IAS_ATTRIBUTE_CLIENT_PACKET_HEADER   = $IAS_ATTRIBUTE_CLIENT_IP_ADDRESS + 1
Const $IAS_ATTRIBUTE_TOKEN_GROUPS   = $IAS_ATTRIBUTE_CLIENT_PACKET_HEADER + 1
Const $IAS_ATTRIBUTE_ALLOW_DIALIN   = $IAS_ATTRIBUTE_TOKEN_GROUPS + 1
Const $IAS_ATTRIBUTE_REQUEST_ID = $IAS_ATTRIBUTE_ALLOW_DIALIN + 1
Const $IAS_ATTRIBUTE_MANIPULATION_TARGET    = $IAS_ATTRIBUTE_REQUEST_ID + 1
Const $IAS_ATTRIBUTE_MANIPULATION_RULE  = $IAS_ATTRIBUTE_MANIPULATION_TARGET + 1
Const $IAS_ATTRIBUTE_ORIGINAL_USER_NAME = $IAS_ATTRIBUTE_MANIPULATION_RULE + 1
Const $IAS_ATTRIBUTE_CLIENT_VENDOR_TYPE = $IAS_ATTRIBUTE_ORIGINAL_USER_NAME + 1
Const $IAS_ATTRIBUTE_CLIENT_UDP_PORT    = $IAS_ATTRIBUTE_CLIENT_VENDOR_TYPE + 1
Const $MS_ATTRIBUTE_CHAP_CHALLENGE  = $IAS_ATTRIBUTE_CLIENT_UDP_PORT + 1
Const $MS_ATTRIBUTE_CHAP_RESPONSE   = $MS_ATTRIBUTE_CHAP_CHALLENGE + 1
Const $MS_ATTRIBUTE_CHAP_DOMAIN = $MS_ATTRIBUTE_CHAP_RESPONSE + 1
Const $MS_ATTRIBUTE_CHAP_ERROR  = $MS_ATTRIBUTE_CHAP_DOMAIN + 1
Const $MS_ATTRIBUTE_CHAP_CPW1   = $MS_ATTRIBUTE_CHAP_ERROR + 1
Const $MS_ATTRIBUTE_CHAP_CPW2   = $MS_ATTRIBUTE_CHAP_CPW1 + 1
Const $MS_ATTRIBUTE_CHAP_LM_ENC_PW  = $MS_ATTRIBUTE_CHAP_CPW2 + 1
Const $MS_ATTRIBUTE_CHAP_NT_ENC_PW  = $MS_ATTRIBUTE_CHAP_LM_ENC_PW + 1
Const $MS_ATTRIBUTE_CHAP_MPPE_KEYS  = $MS_ATTRIBUTE_CHAP_NT_ENC_PW + 1
Const $IAS_ATTRIBUTE_AUTHENTICATION_TYPE    = $MS_ATTRIBUTE_CHAP_MPPE_KEYS + 1
Const $IAS_ATTRIBUTE_CLIENT_NAME    = $IAS_ATTRIBUTE_AUTHENTICATION_TYPE + 1
Const $IAS_ATTRIBUTE_NT4_ACCOUNT_NAME   = $IAS_ATTRIBUTE_CLIENT_NAME + 1
Const $IAS_ATTRIBUTE_FULLY_QUALIFIED_USER_NAME  = $IAS_ATTRIBUTE_NT4_ACCOUNT_NAME + 1
Const $IAS_ATTRIBUTE_NTGROUPS   = $IAS_ATTRIBUTE_FULLY_QUALIFIED_USER_NAME + 1
Const $IAS_ATTRIBUTE_EAP_FRIENDLY_NAME  = $IAS_ATTRIBUTE_NTGROUPS + 1
Const $IAS_ATTRIBUTE_AUTH_PROVIDER_TYPE = $IAS_ATTRIBUTE_EAP_FRIENDLY_NAME + 1
Const $MS_ATTRIBUTE_ACCT_AUTH_TYPE  = $IAS_ATTRIBUTE_AUTH_PROVIDER_TYPE + 1
Const $MS_ATTRIBUTE_ACCT_EAP_TYPE   = $MS_ATTRIBUTE_ACCT_AUTH_TYPE + 1
Const $IAS_ATTRIBUTE_PACKET_TYPE    = $MS_ATTRIBUTE_ACCT_EAP_TYPE + 1
Const $IAS_ATTRIBUTE_AUTH_PROVIDER_NAME = $IAS_ATTRIBUTE_PACKET_TYPE + 1
Const $IAS_ATTRIBUTE_ACCT_PROVIDER_TYPE = $IAS_ATTRIBUTE_AUTH_PROVIDER_NAME + 1
Const $IAS_ATTRIBUTE_ACCT_PROVIDER_NAME = $IAS_ATTRIBUTE_ACCT_PROVIDER_TYPE + 1
Const $MS_ATTRIBUTE_MPPE_SEND_KEY   = $IAS_ATTRIBUTE_ACCT_PROVIDER_NAME + 1
Const $MS_ATTRIBUTE_MPPE_RECV_KEY   = $MS_ATTRIBUTE_MPPE_SEND_KEY + 1
Const $IAS_ATTRIBUTE_REASON_CODE    = $MS_ATTRIBUTE_MPPE_RECV_KEY + 1
Const $MS_ATTRIBUTE_FILTER  = $IAS_ATTRIBUTE_REASON_CODE + 1
Const $MS_ATTRIBUTE_CHAP2_RESPONSE  = $MS_ATTRIBUTE_FILTER + 1
Const $MS_ATTRIBUTE_CHAP2_SUCCESS   = $MS_ATTRIBUTE_CHAP2_RESPONSE + 1
Const $MS_ATTRIBUTE_CHAP2_CPW   = $MS_ATTRIBUTE_CHAP2_SUCCESS + 1
Const $MS_ATTRIBUTE_RAS_VENDOR  = $MS_ATTRIBUTE_CHAP2_CPW + 1
Const $MS_ATTRIBUTE_RAS_VERSION = $MS_ATTRIBUTE_RAS_VENDOR + 1
Const $IAS_ATTRIBUTE_NP_NAME    = $MS_ATTRIBUTE_RAS_VERSION + 1
Const $MS_ATTRIBUTE_PRIMARY_DNS_SERVER  = $IAS_ATTRIBUTE_NP_NAME + 1
Const $MS_ATTRIBUTE_SECONDARY_DNS_SERVER    = $MS_ATTRIBUTE_PRIMARY_DNS_SERVER + 1
Const $MS_ATTRIBUTE_PRIMARY_NBNS_SERVER = $MS_ATTRIBUTE_SECONDARY_DNS_SERVER + 1
Const $MS_ATTRIBUTE_SECONDARY_NBNS_SERVER   = $MS_ATTRIBUTE_PRIMARY_NBNS_SERVER + 1
Const $IAS_ATTRIBUTE_PROXY_POLICY_NAME  = $MS_ATTRIBUTE_SECONDARY_NBNS_SERVER + 1
Const $IAS_ATTRIBUTE_PROVIDER_TYPE  = $IAS_ATTRIBUTE_PROXY_POLICY_NAME + 1
Const $IAS_ATTRIBUTE_PROVIDER_NAME  = $IAS_ATTRIBUTE_PROVIDER_TYPE + 1
Const $IAS_ATTRIBUTE_REMOTE_SERVER_ADDRESS  = $IAS_ATTRIBUTE_PROVIDER_NAME + 1
Const $IAS_ATTRIBUTE_GENERATE_CLASS_ATTRIBUTE   = $IAS_ATTRIBUTE_REMOTE_SERVER_ADDRESS + 1
Const $MS_ATTRIBUTE_RAS_CLIENT_NAME = $IAS_ATTRIBUTE_GENERATE_CLASS_ATTRIBUTE + 1
Const $MS_ATTRIBUTE_RAS_CLIENT_VERSION  = $MS_ATTRIBUTE_RAS_CLIENT_NAME + 1
Const $IAS_ATTRIBUTE_ALLOWED_CERTIFICATE_EKU    = $MS_ATTRIBUTE_RAS_CLIENT_VERSION + 1
Const $IAS_ATTRIBUTE_EXTENSION_STATE    = $IAS_ATTRIBUTE_ALLOWED_CERTIFICATE_EKU + 1
Const $IAS_ATTRIBUTE_GENERATE_SESSION_TIMEOUT   = $IAS_ATTRIBUTE_EXTENSION_STATE + 1
Const $MS_ATTRIBUTE_SESSION_TIMEOUT = $IAS_ATTRIBUTE_GENERATE_SESSION_TIMEOUT + 1
Const $MS_ATTRIBUTE_QUARANTINE_IPFILTER = $MS_ATTRIBUTE_SESSION_TIMEOUT + 1
Const $MS_ATTRIBUTE_QUARANTINE_SESSION_TIMEOUT  = $MS_ATTRIBUTE_QUARANTINE_IPFILTER + 1
Const $MS_ATTRIBUTE_USER_SECURITY_IDENTITY  = $MS_ATTRIBUTE_QUARANTINE_SESSION_TIMEOUT + 1
Const $IAS_ATTRIBUTE_REMOTE_RADIUS_TO_WINDOWS_USER_MAPPING  = $MS_ATTRIBUTE_USER_SECURITY_IDENTITY + 1
Const $IAS_ATTRIBUTE_PASSPORT_USER_MAPPING_UPN_SUFFIX   = $IAS_ATTRIBUTE_REMOTE_RADIUS_TO_WINDOWS_USER_MAPPING + 1
Const $IAS_ATTRIBUTE_TUNNEL_TAG = $IAS_ATTRIBUTE_PASSPORT_USER_MAPPING_UPN_SUFFIX + 1
Const $IAS_ATTRIBUTE_NP_PEAPUPFRONT_ENABLED = $IAS_ATTRIBUTE_TUNNEL_TAG + 1
Const $IAS_ATTRIBUTE_CERTIFICATE_EKU    = 8097
Const $IAS_ATTRIBUTE_EAP_CONFIG = $IAS_ATTRIBUTE_CERTIFICATE_EKU + 1
Const $MS_ATTRIBUTE_PEAP_EMBEDDED_EAP_TYPEID    = $IAS_ATTRIBUTE_EAP_CONFIG + 1
Const $MS_ATTRIBUTE_PEAP_FAST_ROAMED_SESSION    = $MS_ATTRIBUTE_PEAP_EMBEDDED_EAP_TYPEID + 1
Const $IAS_ATTRIBUTE_EAP_TYPEID = $MS_ATTRIBUTE_PEAP_FAST_ROAMED_SESSION + 1
Const $IAS_ATTRIBUTE_EAP_TLV    = $IAS_ATTRIBUTE_EAP_TYPEID + 1
Const $IAS_ATTRIBUTE_REJECT_REASON_CODE = $IAS_ATTRIBUTE_EAP_TLV + 1
Const $IAS_ATTRIBUTE_PROXY_EAP_CONFIG   = $IAS_ATTRIBUTE_REJECT_REASON_CODE + 1
Const $IAS_ATTRIBUTE_EAP_SESSION    = $IAS_ATTRIBUTE_PROXY_EAP_CONFIG + 1
Const $IAS_ATTRIBUTE_IS_REPLAY  = $IAS_ATTRIBUTE_EAP_SESSION + 1
Const $IAS_ATTRIBUTE_CLEAR_TEXT_PASSWORD    = $IAS_ATTRIBUTE_IS_REPLAY + 1
Const $RAS_ATTRIBUTE_ENCRYPTION_TYPE    = 0xffffffff - 89
Const $RAS_ATTRIBUTE_ENCRYPTION_POLICY  = $RAS_ATTRIBUTE_ENCRYPTION_TYPE + 1
Const $RAS_ATTRIBUTE_BAP_REQUIRED   = $RAS_ATTRIBUTE_ENCRYPTION_POLICY + 1
Const $RAS_ATTRIBUTE_BAP_LINE_DOWN_TIME = $RAS_ATTRIBUTE_BAP_REQUIRED + 1
Const $RAS_ATTRIBUTE_BAP_LINE_DOWN_LIMIT    = $RAS_ATTRIBUTE_BAP_LINE_DOWN_TIME + 1

;NEW_LOG_FILE_FREQUENCY
Const $IAS_LOGGING_UNLIMITED_SIZE   = 0
Const $IAS_LOGGING_DAILY    = $IAS_LOGGING_UNLIMITED_SIZE + 1
Const $IAS_LOGGING_WEEKLY   = $IAS_LOGGING_DAILY + 1
Const $IAS_LOGGING_MONTHLY  = $IAS_LOGGING_WEEKLY + 1
Const $IAS_LOGGING_WHEN_FILE_SIZE_REACHES   = $IAS_LOGGING_MONTHLY + 1

;AUTHENTICATION_TYPE
Const $IAS_AUTH_INVALID = 0
Const $IAS_AUTH_PAP = $IAS_AUTH_INVALID + 1
Const $IAS_AUTH_MD5CHAP = $IAS_AUTH_PAP + 1
Const $IAS_AUTH_MSCHAP  = $IAS_AUTH_MD5CHAP + 1
Const $IAS_AUTH_MSCHAP2 = $IAS_AUTH_MSCHAP + 1
Const $IAS_AUTH_EAP = $IAS_AUTH_MSCHAP2 + 1
Const $IAS_AUTH_ARAP    = $IAS_AUTH_EAP + 1
Const $IAS_AUTH_NONE    = $IAS_AUTH_ARAP + 1
Const $IAS_AUTH_CUSTOM  = $IAS_AUTH_NONE + 1
Const $IAS_AUTH_MSCHAP_CPW  = $IAS_AUTH_CUSTOM + 1
Const $IAS_AUTH_MSCHAP2_CPW = $IAS_AUTH_MSCHAP_CPW + 1
Const $IAS_AUTH_PEAP    = $IAS_AUTH_MSCHAP2_CPW + 1

;ATTRIBUTESYNTAX
Const $IAS_SYNTAX_BOOLEAN   = 1
Const $IAS_SYNTAX_INTEGER   = $IAS_SYNTAX_BOOLEAN + 1
Const $IAS_SYNTAX_ENUMERATOR    = $IAS_SYNTAX_INTEGER + 1
Const $IAS_SYNTAX_INETADDR  = $IAS_SYNTAX_ENUMERATOR + 1
Const $IAS_SYNTAX_STRING    = $IAS_SYNTAX_INETADDR + 1
Const $IAS_SYNTAX_OCTETSTRING   = $IAS_SYNTAX_STRING + 1
Const $IAS_SYNTAX_UTCTIME   = $IAS_SYNTAX_OCTETSTRING + 1
Const $IAS_SYNTAX_PROVIDERSPECIFIC  = $IAS_SYNTAX_UTCTIME + 1
Const $IAS_SYNTAX_UNSIGNEDINTEGER   = $IAS_SYNTAX_PROVIDERSPECIFIC + 1

;IASCOMMONPROPERTIES
Const $PROPERTY_SDO_RESERVED    = 0
Const $PROPERTY_SDO_CLASS   = $PROPERTY_SDO_RESERVED + 1
Const $PROPERTY_SDO_NAME    = $PROPERTY_SDO_CLASS + 1
Const $PROPERTY_SDO_DESCRIPTION = $PROPERTY_SDO_NAME + 1
Const $PROPERTY_SDO_ID  = $PROPERTY_SDO_DESCRIPTION + 1
Const $PROPERTY_SDO_DATASTORE_NAME  = $PROPERTY_SDO_ID + 1
Const $PROPERTY_SDO_START   = 0x400
;USERPROPERTIES
Const $PROPERTY_USER_CALLING_STATION_ID = $PROPERTY_SDO_START
Const $PROPERTY_USER_SAVED_CALLING_STATION_ID   = $PROPERTY_USER_CALLING_STATION_ID + 1
Const $PROPERTY_USER_RADIUS_CALLBACK_NUMBER = $PROPERTY_USER_SAVED_CALLING_STATION_ID + 1
Const $PROPERTY_USER_RADIUS_FRAMED_ROUTE    = $PROPERTY_USER_RADIUS_CALLBACK_NUMBER + 1
Const $PROPERTY_USER_RADIUS_FRAMED_IP_ADDRESS   = $PROPERTY_USER_RADIUS_FRAMED_ROUTE + 1
Const $PROPERTY_USER_SAVED_RADIUS_CALLBACK_NUMBER   = $PROPERTY_USER_RADIUS_FRAMED_IP_ADDRESS + 1
Const $PROPERTY_USER_SAVED_RADIUS_FRAMED_ROUTE  = $PROPERTY_USER_SAVED_RADIUS_CALLBACK_NUMBER + 1
Const $PROPERTY_USER_SAVED_RADIUS_FRAMED_IP_ADDRESS = $PROPERTY_USER_SAVED_RADIUS_FRAMED_ROUTE + 1
Const $PROPERTY_USER_ALLOW_DIALIN   = $PROPERTY_USER_SAVED_RADIUS_FRAMED_IP_ADDRESS + 1
Const $PROPERTY_USER_SERVICE_TYPE   = $PROPERTY_USER_ALLOW_DIALIN + 1
;DICTIONARYPROPERTIES
Const $PROPERTY_DICTIONARY_ATTRIBUTES_COLLECTION    = $PROPERTY_SDO_START
Const $PROPERTY_DICTIONARY_LOCATION = $PROPERTY_DICTIONARY_ATTRIBUTES_COLLECTION + 1
;ATTRIBUTEPROPERTIES
Const $PROPERTY_ATTRIBUTE_ID    = $PROPERTY_SDO_START
Const $PROPERTY_ATTRIBUTE_VENDOR_ID = $PROPERTY_ATTRIBUTE_ID + 1
Const $PROPERTY_ATTRIBUTE_VENDOR_TYPE_ID    = $PROPERTY_ATTRIBUTE_VENDOR_ID + 1
Const $PROPERTY_ATTRIBUTE_IS_ENUMERABLE = $PROPERTY_ATTRIBUTE_VENDOR_TYPE_ID + 1
Const $PROPERTY_ATTRIBUTE_ENUM_NAMES    = $PROPERTY_ATTRIBUTE_IS_ENUMERABLE + 1
Const $PROPERTY_ATTRIBUTE_ENUM_VALUES   = $PROPERTY_ATTRIBUTE_ENUM_NAMES + 1
Const $PROPERTY_ATTRIBUTE_SYNTAX    = $PROPERTY_ATTRIBUTE_ENUM_VALUES + 1
Const $PROPERTY_ATTRIBUTE_ALLOW_MULTIPLE    = $PROPERTY_ATTRIBUTE_SYNTAX + 1
Const $PROPERTY_ATTRIBUTE_ALLOW_LOG_ORDINAL = $PROPERTY_ATTRIBUTE_ALLOW_MULTIPLE + 1
Const $PROPERTY_ATTRIBUTE_ALLOW_IN_PROFILE  = $PROPERTY_ATTRIBUTE_ALLOW_LOG_ORDINAL + 1
Const $PROPERTY_ATTRIBUTE_ALLOW_IN_CONDITION    = $PROPERTY_ATTRIBUTE_ALLOW_IN_PROFILE + 1
Const $PROPERTY_ATTRIBUTE_DISPLAY_NAME  = $PROPERTY_ATTRIBUTE_ALLOW_IN_CONDITION + 1
Const $PROPERTY_ATTRIBUTE_VALUE = $PROPERTY_ATTRIBUTE_DISPLAY_NAME + 1
Const $PROPERTY_ATTRIBUTE_ALLOW_IN_PROXY_PROFILE    = $PROPERTY_ATTRIBUTE_VALUE + 1
Const $PROPERTY_ATTRIBUTE_ALLOW_IN_PROXY_CONDITION  = $PROPERTY_ATTRIBUTE_ALLOW_IN_PROXY_PROFILE + 1

;IASPROPERTIES
 Const $PROPERTY_IAS_RADIUSSERVERGROUPS_COLLECTION  = $PROPERTY_SDO_START
Const $PROPERTY_IAS_POLICIES_COLLECTION = $PROPERTY_IAS_RADIUSSERVERGROUPS_COLLECTION + 1
Const $PROPERTY_IAS_PROFILES_COLLECTION = $PROPERTY_IAS_POLICIES_COLLECTION + 1
Const $PROPERTY_IAS_PROTOCOLS_COLLECTION    = $PROPERTY_IAS_PROFILES_COLLECTION + 1
Const $PROPERTY_IAS_AUDITORS_COLLECTION = $PROPERTY_IAS_PROTOCOLS_COLLECTION + 1
Const $PROPERTY_IAS_REQUESTHANDLERS_COLLECTION  = $PROPERTY_IAS_AUDITORS_COLLECTION + 1
Const $PROPERTY_IAS_PROXYPOLICIES_COLLECTION    = $PROPERTY_IAS_REQUESTHANDLERS_COLLECTION + 1
Const $PROPERTY_IAS_PROXYPROFILES_COLLECTION    = $PROPERTY_IAS_PROXYPOLICIES_COLLECTION + 1

;CLIENTPROPERTIES
Const $PROPERTY_CLIENT_REQUIRE_SIGNATURE    = $PROPERTY_SDO_START
Const $PROPERTY_CLIENT_UNUSED   = $PROPERTY_CLIENT_REQUIRE_SIGNATURE + 1
Const $PROPERTY_CLIENT_SHARED_SECRET    = $PROPERTY_CLIENT_UNUSED + 1
Const $PROPERTY_CLIENT_NAS_MANUFACTURER = $PROPERTY_CLIENT_SHARED_SECRET + 1
Const $PROPERTY_CLIENT_ADDRESS  = $PROPERTY_CLIENT_NAS_MANUFACTURER + 1

;VENDORPROPERTIES
Const $PROPERTY_NAS_VENDOR_ID   = $PROPERTY_SDO_START

;PROFILEPROPERTIES
Const $PROPERTY_PROFILE_ATTRIBUTES_COLLECTION   = $PROPERTY_SDO_START

;POLICYPROPERTIES
Const $PROPERTY_POLICY_CONSTRAINT   = $PROPERTY_SDO_START
Const $PROPERTY_POLICY_MERIT    = $PROPERTY_POLICY_CONSTRAINT + 1
Const $PROPERTY_POLICY_UNUSED0  = $PROPERTY_POLICY_MERIT + 1
Const $PROPERTY_POLICY_UNUSED1  = $PROPERTY_POLICY_UNUSED0 + 1
Const $PROPERTY_POLICY_PROFILE_NAME = $PROPERTY_POLICY_UNUSED1 + 1
Const $PROPERTY_POLICY_ACTION   = $PROPERTY_POLICY_PROFILE_NAME + 1
Const $PROPERTY_POLICY_CONDITIONS_COLLECTION    = $PROPERTY_POLICY_ACTION + 1

;CONDITIONPROPERTIES
Const $PROPERTY_CONDITION_TEXT  = $PROPERTY_SDO_START

;RADIUSSERVERGROUPPROPERTIES
Const $PROPERTY_RADIUSSERVERGROUP_SERVERS_COLLECTION    = $PROPERTY_SDO_START

;RADIUSSERVERPROPERTIES
Const $PROPERTY_RADIUSSERVER_AUTH_PORT  = $PROPERTY_SDO_START
Const $PROPERTY_RADIUSSERVER_AUTH_SECRET    = $PROPERTY_RADIUSSERVER_AUTH_PORT + 1
Const $PROPERTY_RADIUSSERVER_ACCT_PORT  = $PROPERTY_RADIUSSERVER_AUTH_SECRET + 1
Const $PROPERTY_RADIUSSERVER_ACCT_SECRET    = $PROPERTY_RADIUSSERVER_ACCT_PORT + 1
Const $PROPERTY_RADIUSSERVER_ADDRESS    = $PROPERTY_RADIUSSERVER_ACCT_SECRET + 1
Const $PROPERTY_RADIUSSERVER_FORWARD_ACCT_ONOFF = $PROPERTY_RADIUSSERVER_ADDRESS + 1
Const $PROPERTY_RADIUSSERVER_PRIORITY   = $PROPERTY_RADIUSSERVER_FORWARD_ACCT_ONOFF + 1
Const $PROPERTY_RADIUSSERVER_WEIGHT = $PROPERTY_RADIUSSERVER_PRIORITY + 1
Const $PROPERTY_RADIUSSERVER_TIMEOUT    = $PROPERTY_RADIUSSERVER_WEIGHT + 1
Const $PROPERTY_RADIUSSERVER_MAX_LOST   = $PROPERTY_RADIUSSERVER_TIMEOUT + 1
Const $PROPERTY_RADIUSSERVER_BLACKOUT   = $PROPERTY_RADIUSSERVER_MAX_LOST + 1

;IASCOMPONENTPROPERTIES
Const $PROPERTY_COMPONENT_ID    = $PROPERTY_SDO_START
Const $PROPERTY_COMPONENT_PROG_ID   = $PROPERTY_COMPONENT_ID + 1
Const $PROPERTY_COMPONENT_START = $PROPERTY_COMPONENT_PROG_ID + 1

;PROTOCOLPROPERTIES
Const $PROPERTY_PROTOCOL_REQUEST_HANDLER    = $PROPERTY_COMPONENT_START
Const $PROPERTY_PROTOCOL_START  = $PROPERTY_PROTOCOL_REQUEST_HANDLER + 1

;RADIUSPROPERTIES
Const $PROPERTY_RADIUS_ACCOUNTING_PORT  = $PROPERTY_PROTOCOL_START
Const $PROPERTY_RADIUS_AUTHENTICATION_PORT  = $PROPERTY_RADIUS_ACCOUNTING_PORT + 1
Const $PROPERTY_RADIUS_CLIENTS_COLLECTION   = $PROPERTY_RADIUS_AUTHENTICATION_PORT + 1
Const $PROPERTY_RADIUS_VENDORS_COLLECTION   = $PROPERTY_RADIUS_CLIENTS_COLLECTION + 1

;NTEVENTLOGPROPERTIES
Const $PROPERTY_EVENTLOG_LOG_APPLICATION_EVENTS = $PROPERTY_COMPONENT_START
Const $PROPERTY_EVENTLOG_LOG_MALFORMED  = $PROPERTY_EVENTLOG_LOG_APPLICATION_EVENTS + 1
Const $PROPERTY_EVENTLOG_LOG_DEBUG  = $PROPERTY_EVENTLOG_LOG_MALFORMED + 1

;NAMESPROPERTIES
Const $PROPERTY_NAMES_REALMS    = $PROPERTY_COMPONENT_START

;NTSAMPROPERTIES
Const $PROPERTY_NTSAM_ALLOW_LM_AUTHENTICATION   = $PROPERTY_COMPONENT_START

;ACCOUNTINGPROPERTIES
Const $PROPERTY_ACCOUNTING_LOG_ACCOUNTING   = $PROPERTY_COMPONENT_START
Const $PROPERTY_ACCOUNTING_LOG_ACCOUNTING_INTERIM   = $PROPERTY_ACCOUNTING_LOG_ACCOUNTING + 1
Const $PROPERTY_ACCOUNTING_LOG_AUTHENTICATION   = $PROPERTY_ACCOUNTING_LOG_ACCOUNTING_INTERIM + 1
Const $PROPERTY_ACCOUNTING_LOG_OPEN_NEW_FREQUENCY   = $PROPERTY_ACCOUNTING_LOG_AUTHENTICATION + 1
Const $PROPERTY_ACCOUNTING_LOG_OPEN_NEW_SIZE    = $PROPERTY_ACCOUNTING_LOG_OPEN_NEW_FREQUENCY + 1
Const $PROPERTY_ACCOUNTING_LOG_FILE_DIRECTORY   = $PROPERTY_ACCOUNTING_LOG_OPEN_NEW_SIZE + 1
Const $PROPERTY_ACCOUNTING_LOG_IAS1_FORMAT  = $PROPERTY_ACCOUNTING_LOG_FILE_DIRECTORY + 1
Const $PROPERTY_ACCOUNTING_LOG_ENABLE_LOGGING   = $PROPERTY_ACCOUNTING_LOG_IAS1_FORMAT + 1
Const $PROPERTY_ACCOUNTING_LOG_DELETE_IF_FULL   = $PROPERTY_ACCOUNTING_LOG_ENABLE_LOGGING + 1
Const $PROPERTY_ACCOUNTING_SQL_MAX_SESSIONS = $PROPERTY_ACCOUNTING_LOG_DELETE_IF_FULL + 1
Const $PROPERTY_ACCOUNTING_LOG_AUTHENTICATION_INTERIM   = $PROPERTY_ACCOUNTING_SQL_MAX_SESSIONS + 1

;EAPWRAPPROPERTIES
Const $PROPERTY_EAP_SESSION_TIMEOUT = $PROPERTY_COMPONENT_START
Const $PROPERTY_EAP_MAX_SESSIONS    = $PROPERTY_EAP_SESSION_TIMEOUT + 1

;NAPPROPERTIES
Const $PROPERTY_NAP_POLICIES_COLLECTION = $PROPERTY_COMPONENT_START

;RADIUSPROXYPROPERTIES
Const $PROPERTY_RADIUSPROXY_SERVERGROUPS    = $PROPERTY_COMPONENT_START

;SERVICE_TYPE
Const $SERVICE_TYPE_IAS = 0
Const $SERVICE_TYPE_RAS = $SERVICE_TYPE_IAS + 1
Const $SERVICE_TYPE_MAX = $SERVICE_TYPE_RAS + 1

;IASOSTYPE
Const $SYSTEM_TYPE_NT4_WORKSTATION  = 0
Const $SYSTEM_TYPE_NT5_WORKSTATION  = $SYSTEM_TYPE_NT4_WORKSTATION + 1
Const $SYSTEM_TYPE_NT4_SERVER   = $SYSTEM_TYPE_NT5_WORKSTATION + 1
Const $SYSTEM_TYPE_NT5_SERVER   = $SYSTEM_TYPE_NT4_SERVER + 1

;DOMAINTYPE
Const $DOMAIN_TYPE_NONE = 0
Const $DOMAIN_TYPE_NT4  = $DOMAIN_TYPE_NONE + 1
Const $DOMAIN_TYPE_NT5  = $DOMAIN_TYPE_NT4 + 1
Const $DOMAIN_TYPE_MIXED    = $DOMAIN_TYPE_NT5 + 1

;IASDATASTORE
Const $DATA_STORE_LOCAL = 0
Const $DATA_STORE_DIRECTORY = $DATA_STORE_LOCAL + 1

#endregion Define IAS Constants

Dim $sdoMachine, $sdoServiceSDO
Dim $sdoCollProfiles, $sdoCollProtocols, $sdoCollClients, $sdoCollPolicies
Dim $sdoCollAttributes, $sdoCollConditions
Dim $sdoRADIUS
Dim $vtProfile, $vtProtocol, $vtClient, $vtPolicy, $vtAttribute, $vtCondition
Dim $sServerName

$sServerName="server1"

$sdoMachine = ObjCreate("IAS.SdoMachine")
If @error Then
    MsgBox(0, "Error", "Error create IAS.SdoMachine object")
    Exit(1)
EndIf


$sdoMachine.Attach($sServerName)

$sdoServiceSDO = $sdoMachine.GetServiceSDO($DATA_STORE_LOCAL, "IAS")
If @error Then
    MsgBox(0, "Error", "Error get service SDO")
    Exit(1)
EndIf

;
; List Clients
;
$sdoCollProtocols = $sdoServiceSDO.GetProperty($PROPERTY_IAS_PROTOCOLS_COLLECTION)

$sdoRADIUS = $sdoCollProtocols.Item("Microsoft Radius Protocol")
$sdoCollClients = $sdoRADIUS.GetProperty($PROPERTY_RADIUS_CLIENTS_COLLECTION)

MsgBox(0, "Info", "On Server: " & $sServerName & " found " & $sdoCollClients.Count & " client(s).")
For $vtClient in $sdoCollClients
    MsgBox(0, "Detail", "Client Friendly Name: " & $vtClient.GetProperty($PROPERTY_SDO_NAME) & @CRLF & "Shared Secret: " & $vtClient.GetProperty($PROPERTY_CLIENT_SHARED_SECRET) & @CRLF & "IP Address: " & $vtClient.GetProperty($PROPERTY_CLIENT_ADDRESS))
Next ;$vtClient

When I try run this script, autoit will failed with exit code: -1073741819

After tracing line per line, I found it is caused by this line:

$sdoCollProtocols = $sdoServiceSDO.GetProperty($PROPERTY_IAS_PROTOCOLS_COLLECTION)

Seems the GetProperty method could not work in Autoit while it's fine in vbscript.

Anybody could help me here?

Thx a lot :(

Share this post


Link to post
Share on other sites



When I try run this script, autoit will failed with exit code: -1073741819

That's 0xC0000005 which means "Access violation". MS returns some results.

Can you verify that the line

$sdoMachine.Attach($sServerName)
does not return any errors?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I just try to catch the @error after the Attach command. It's 0 which should means correctly executed.

Is there any other approach to check if the command correctly execute?

BTW: These codes only worked on a server that has IAS component installed, or else it will failed on the below line:

$sdoServiceSDO = $sdoMachine.GetServiceSDO($DATA_STORE_LOCAL, "IAS")

Share this post


Link to post
Share on other sites

You could set up an COM error handler to gather as much informtion as posible:

; Set up COM error handler
Global $oMyError = ObjEvent("AutoIt.Error", "_My_ErrorHandler")

... Your script ...

Func _My_ErrorHandler()

Local $bHexNumber = Hex($oMyError.number, 8)
ConsoleWrite("COM Error Encountered in " & @ScriptName & @CRLF & _
        "Scriptline = " & $oMyError.scriptline & @CRLF & _
        "NumberHex = " & $bHexNumber & @CRLF & _
        "Number = " & $oMyError.number & @CRLF & _
        "WinDescription = " & StringStripWS($oMyError.WinDescription, 2) & @CRLF & _
        "Description = " & StringStripWS($oMyError.description, 2) & @CRLF & _
        "Source = " & $oMyError.Source & @CRLF & _
        "HelpFile = " & $oMyError.HelpFile & @CRLF & _
        "HelpContext = " & $oMyError.HelpContext & @CRLF & _
        "LastDllError = " & $oMyError.LastDllError & @CRLF & _
        "========================================================" & @CRLF)

EndFunc

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Actually I use that error handler in original script. But it does not catch any errors for this script. :idea:

Share this post


Link to post
Share on other sites

Actually I use that error handler in original script. But it does not catch any errors for this script. :idea:

In this case I've run out of ideas :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Then...I'll keep debug it myself.

Thank u very much

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0