Microsoft outlook как достать список адресов с exchange - VB
Формулировка задачи:
Добрый день! Есть сервер Exchange с которого нужно получить список адрессов... можно при помощи отлука можно без... Хоть как-то подскажите откуда искать?
Решение задачи: «Microsoft outlook как достать список адресов с exchange»
textual
Листинг программы
<font color="blue">Option</font> <font color="blue">Compare</font> Database <font color="blue">Option</font> <font color="blue">Explicit</font> <font color="blue">Const</font> groupType = <font color="darkblue"><b>268435456</b></font> <font color="blue">Const</font> userType = <font color="darkblue"><b>805306368</b></font> <font color="blue">Const</font> companyName = <font color="teal">"Interterminal"</font> <font color="blue">Private</font> GABName <font color="blue">As</font> <font color="blue">String</font> <font color="blue">Private</font> DC <font color="blue">As</font> <font color="blue">String</font> <font color="blue">Public</font> <font color="blue">Property</font> <font color="blue">Let</font> <font color="blue">name</font>(s <font color="blue">As</font> <font color="blue">String</font>) GABName = s <font color="blue">End</font> <font color="blue">Property</font> <font color="blue">Public</font> <font color="blue">Property</font> <font color="blue">Get</font> <font color="blue">name</font>() <font color="blue">As</font> <font color="blue">String</font> <font color="blue">name</font> = GABName <font color="blue">End</font> <font color="blue">Property</font> <font color="blue">Public</font> <font color="blue">Property</font> <font color="blue">Let</font> domainController(s <font color="blue">As</font> <font color="blue">String</font>) DC = s <font color="blue">End</font> <font color="blue">Property</font> <font color="blue">Public</font> <font color="blue">Property</font> <font color="blue">Get</font> domainController() <font color="blue">As</font> <font color="blue">String</font> domainController = DC <font color="blue">End</font> <font color="blue">Property</font> <font color="blue">Private</font> <font color="blue">Function</font> configurationNamingContext() <font color="blue">As</font> <font color="blue">String</font> <font color="blue">Dim</font> root <font color="blue">Set</font> root = GetObject(<font color="teal">"LDAP://"</font> & DC & <font color="teal">"/RootDSE"</font>) configurationNamingContext = root.<font color="blue">Get</font>(<font color="teal">"configurationNamingContext"</font>) <font color="blue">Set</font> root = <font color="blue">Nothing</font> <font color="blue">End</font> <font color="blue">Function</font> <font color="blue">Private</font> <font color="blue">Function</font> defaultNamingContext() <font color="blue">As</font> <font color="blue">String</font> <font color="blue">Dim</font> root <font color="blue">Set</font> root = GetObject(<font color="teal">"LDAP://"</font> & DC & <font color="teal">"/RootDSE"</font>) defaultNamingContext = root.<font color="blue">Get</font>(<font color="teal">"defaultNamingContext"</font>) <font color="blue">Set</font> root = <font color="blue">Nothing</font> <font color="blue">End</font> <font color="blue">Function</font> <font color="blue">Public</font> <font color="blue">Function</font> getGroupList() <font color="blue">As</font> ADODB.Recordset <font color="blue">Dim</font> con <font color="blue">As</font> <font color="blue">New</font> ADODB.Connection <font color="blue">Dim</font> rst <font color="blue">As</font> <font color="blue">New</font> ADODB.Recordset <font color="blue">Dim</font> strSearchRoot <font color="blue">As</font> <font color="blue">String</font> <font color="blue">Dim</font> GALName <font color="blue">As</font> <font color="blue">String</font> strSearchRoot = <font color="teal">"LDAP://"</font> & DC & <font color="teal">"/"</font> & defaultNamingContext con.provider = <font color="teal">"ADsDSOObject"</font> con.<font color="blue">Open</font> <font color="blue">Set</font> rst.activeConnection = con GALName = <font color="teal">"'CN="</font> & <font color="blue">name</font> & <font color="teal">",CN=All Global Address Lists,CN=Address Lists Container,CN="</font> & companyName & <font color="teal">",CN=Microsoft Exchange,CN=Services,"</font> & configurationNamingContext & <font color="teal">"'"</font> rst.<font color="blue">Open</font> <font color="teal">"SELECT displayName,mail,name From '"</font> & strSearchRoot & <font color="teal">"' WHERE sAMAccountType="</font> & groupType & <font color="teal">" and msExchHideFromAddressLists <> true and showInAddressBook="</font> & GALName & <font color="teal">""</font> <font color="blue">Set</font> getGroupList = rst <font color="blue">End</font> <font color="blue">Function</font> <font color="blue">Private</font> <font color="blue">Sub</font> Class_Initialize() GABName = <font color="teal">"Default Global Address List"</font> <font color="blue">End</font> <font color="blue">Sub</font>
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д