DirectoryServices (.NET) and Exchange 5.5 on NT4

DirectoryServices (.NET) and Exchange 5.5 on NT4

Post by Jason Saxo » Fri, 06 Dec 2002 09:10:18



I'm having a bit of a problem accessing Exchange 5.5 LDAP through .NET on
NT4. My guess is there is some dependancy missing for the framework.

I am using NT4 sp6a, .Net Framework SP2

The below code works on Windows 2000 (where ServerName is NT or 2000) but
returns Unknown Error when running on NT (the return is instant and
regardless of the connection string).

Any pointers are greatly appreciated.

        Dim adSearcher As New DirectoryServices.DirectorySearcher()
        Dim adDirEntry As New DirectoryServices.DirectoryEntry()
        Dim adSearchResults As DirectoryServices.SearchResultCollection
        Dim adResult As DirectoryServices.SearchResult

        adDirEntry.Path = TextBox1.Text
'(LDAP://ServerName:7000/ou=xxx,o=xxx)
        adDirEntry.AuthenticationType =
DirectoryServices.AuthenticationTypes.Secure
        adSearcher.SearchRoot = adDirEntry
        ListBox1.Items.Clear()
        adSearcher.PageSize = 25
        Try

            adSearchResults = adSearcher.FindAll() '''''''''This is the line
that erorrs
            For Each adResult In adSearchResults
                Try
                    ListBox1.Items.Add(adResult.Properties("CN")(0))
                Catch
                    'MsgBox(Err.Description)

                End Try
            Next
        Catch
            MsgBox(Err.Source + ": " + Err.Number.ToString + " -- " +
Err.Description)
        End Try

 
 
 

DirectoryServices (.NET) and Exchange 5.5 on NT4

Post by Weiqing Tu [MS » Fri, 06 Dec 2002 12:01:54


Do you have DSClient installed on your NT4 box? System.DirectoryServices
uses ADSI, you need to have it installed. On win2k, ADSI is already part of
the OS, so you don't have problem.

weiqing tu

This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:> I'm having a bit of a problem accessing Exchange 5.5 LDAP through .NET on
> NT4. My guess is there is some dependancy missing for the framework.

> I am using NT4 sp6a, .Net Framework SP2

> The below code works on Windows 2000 (where ServerName is NT or 2000) but
> returns Unknown Error when running on NT (the return is instant and
> regardless of the connection string).

> Any pointers are greatly appreciated.

>         Dim adSearcher As New DirectoryServices.DirectorySearcher()
>         Dim adDirEntry As New DirectoryServices.DirectoryEntry()
>         Dim adSearchResults As DirectoryServices.SearchResultCollection
>         Dim adResult As DirectoryServices.SearchResult

>         adDirEntry.Path = TextBox1.Text
> '(LDAP://ServerName:7000/ou=xxx,o=xxx)
>         adDirEntry.AuthenticationType =
> DirectoryServices.AuthenticationTypes.Secure
>         adSearcher.SearchRoot = adDirEntry
>         ListBox1.Items.Clear()
>         adSearcher.PageSize = 25
>         Try

>             adSearchResults = adSearcher.FindAll() '''''''''This is the
line
> that erorrs
>             For Each adResult In adSearchResults
>                 Try
>                     ListBox1.Items.Add(adResult.Properties("CN")(0))
>                 Catch
>                     'MsgBox(Err.Description)

>                 End Try
>             Next
>         Catch
>             MsgBox(Err.Source + ": " + Err.Number.ToString + " -- " +
> Err.Description)
>         End Try


 
 
 

1. LDAP, Exchange 5.5, .NET, C#, System.DirectoryServices, smtp address

I'm trying to do something I would be quite simple, however, I've
spent the last 6 hours fumbling around with it and getting nowhereso
any help would be appreciated.

Goal:
   * Simply access the SMPT address or a users exchange account
   * Not use COM, CDONTS, Exchange SDK, etc only use
System.DirectoryServices
   * Supply a valid AD account last name, search for the most likely
match(s), return an array of email addresses, populate a dropdown box
with the choices.

Environment:
   * Win2k, Active Directory
   * NT4, Exchange 5.5 (trust w/ AD for accounts)
 --account names in AD are not the same as Exchange
 --I.e.  Exchange -> msmith
                AD  -> mike.smith
   * C#, .NET development environment

...Where is the "SMTP" or "Mail" property?...

The 'cn' in the 'adspath' and the 'distinguishedname' of the
SearchResult are not always usable; sometimes having HEX number - so
parsing the email out is no good.

Can this be done?...where should I look?

Thanks for any help in advance!

Mike

2. Alternate sources for high-speed modem cable for Indigo?

3. 'Logon Failure' from ASP.NET app using DirectoryServices against Exchange 5.5 LDAP

4. Apple //c + Software 4 sale

5. NT4 Exchange 5.5 -> SBS2000 Exchange 2000

6. Hover button and Netscape 3.01

7. Migration NT4 Exchange 5.5 to SBS2000 Exchange 2000

8. How to migrate from Exchange 5.5 to SBS 4.5 Exchange 5.5 SP2?

9. Exchange 5.5 GAL with .NET

10. LDAP query against Exchange 5.5 using .NET ?

11. Connecting remote SBS to central NT4/exchange 5.5 server

12. Upgrade from NT4 server and exchange 5.5 to w2kSBS