????? ????? ??????? ????? & ?????? Exchange ?? ADSI

?????? ????????? ?????? ?????????
???? ???????: 200726 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ????? ????????? ???????? ?????? ?? Visual Basic ??????? ?????? ???? LDAP ADSI ????? ???? ??????? ??????? ???????? ?? ????? Exchange. ???????? ??? ???????? ???????? ??? ?? ???? ???? ???? Exchange 5.5 ???? ??? ????? ?? ??????? ??????? ?????? ??. ??? ?? ???? ??? ????? ??? ???? ADSI ?????? ??????? (??????? 2.0 ?? ????) ??????? ??? ?????? ????? ??.

??????? ????

????? ????? ????? ??????

  1. ???? ???? ????? Visual Basic EXE ?????.
  2. ????? ???? ?????.
  3. ????? ???? ??? ????? ??? DS ??????.
  4. ????? ???? ??? ??????? ??? Sub ???????.
  5. ??? ?? ??? ????? ???????? ???????? ??????? ?? ?????? ???????:
' Sample to enumerate sites and servers in an Exchange Organization
' using ADSi objects

   Option Explicit

   Sub Main()

   Dim objOrg As IADsContainer
   Dim objOU As IADsContainer
   Dim objConfig As IADsContainer
   Dim objServers As IADsContainer
   Dim obj As IADs

   ' Replace "Server" with the name of any Exchange 5.5 server in one of
   ' the connected sites you want to enumerate.
   Set objOrg = GetObject("LDAP://Server")
   Debug.Print objOrg.Name

   ' filter passes organizationalUnit and any classes derived from it
   ' such as View-Root
   objOrg.Filter = Array("organizationalUnit")
   For Each objOU In objOrg

    With objOU
    ' Test that the most derived class is organizationalUnit
    If objOU.Class = "organizationalUnit" Then
        Debug.Print "Site: " + .Name
        objOU.Filter = Array("Container")
        For Each objConfig In objOU
            With objConfig
            ' Test for cn=Configuration (root container)
            If .Name = "cn=Configuration" Then
                ' In case configuration might have non-containers
                .Filter = Array("Container")
                For Each objServers In objConfig
                    With objServers
                    ' Test for cn=Servers inside of Configuration container
                    If .Name = "cn=Servers" Then
                        .Filter = Array("Computer")
                        For Each obj In objServers
                            With obj
                            Debug.Print Chr(9) & "Server: " & .Name
                            Debug.Print Chr(9) & "ADsPath: "; .ADsPath
                            End With
                        Next obj
                    End If
                    End With
                Next objServers
            End If
            End With
        Next objConfig
    End If
    End With

   Next objOU
   Debug.Print "End Enumeration"

   End Sub
				

?????

??? ????? ??????? ??? ADSI ??????? 2.0 ?? ?????? Platform SDK ?? MSDN ??? ?????? 1997. ADSI ?????? ????? ??? ???? ??? ??????: http://msdn.microsoft.com/en-us/library/aa772170.aspx

???????

???? ???????: 200726 - ????? ??? ??????: 06/???? ?????/1430 - ??????: 4.0
????? ???
  • Microsoft Platform Software Development Kit-January 2000 Edition
  • Microsoft Visual Basic 5.0 Learning Edition, ????? ?????? ??:
    • Microsoft Windows NT 4.0
    • Microsoft Windows 95
  • Microsoft Visual Basic 5.0 Professional Edition, ????? ?????? ??:
    • Microsoft Windows NT 4.0
    • Microsoft Windows 95
  • Microsoft Visual Basic 5.0 Enterprise Edition, ????? ?????? ??:
    • Microsoft Windows NT 4.0
    • Microsoft Windows 95
  • Microsoft Exchange Server 2003 Software Development Kit, ????? ?????? ??:
    • Microsoft Windows NT 4.0
    • Microsoft Windows 95
  • Microsoft Exchange Server 5.5 Standard Edition
  • Microsoft Active Directory Service Interfaces 2.0
????? ??????: 
kbmt kbdswmanage2003swept kbapi kbhowto kbmsg KB200726 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????200726

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com