Results 1 to 2 of 2

Thread: LDAP query to two different domains

  1. #1
    Join Date
    Feb 2009
    Posts
    5

    LDAP query to two different domains

    Hello,

    I have two different Domains (AWGE and WALKGROUP).
    Our company is getting migrated to WALKGROUP domain.AWGE is the original one.
    THEy are not migrating all the users at one time.Hence in our wcf service applications , web applications we need to manage our code in such a way that if one user belongs to AWGE domain the this LDAP query should run (LDAP://AWGE.Local) else if user belongs to WALKGROUP domain this query should run LDAP://WALKGROUP.com.
    How can I achieve this.Can I run two LADP strings at the same time.

    Dim domain As String = System.Environment.UserDomainName.ToString

    'If domain.Contains("AWGE") = True Then
    ' strDomPath = "LDAP://AWGE.Local"

    'Else
    ' strDomPath = "LDAP://WALKGROUP.com"

    'End If
    Dim entry As New DirectoryEntry(strDomPath)
    Dim objSearch As New DirectorySearcher(entry)
    objSearch.Filter = "(samAccountName=" + samAccountName + ")"
    Dim objresult As DirectoryServices.SearchResult = objSearch.FindOne
    Result = objresult.GetDirectoryEntry().Properties("name").Value
    Return Result

  2. #2
    Join Date
    Dec 2007
    Posts
    2,291

    Re: LDAP query to two different domains

    Have you tried to authenticate using username and password to ensure that the other domain know where to look for credentials. Some info on alternate credentials that might help:

    http://www.rlmueller.net/ADOAltCredentials.htm

Similar Threads

  1. LDAP query to speficied LDAP server on TCP port 389 failed
    By Shash in forum Windows Server Help
    Replies: 2
    Last Post: 02-05-2012, 05:01 PM
  2. LDAP Query AD
    By shivinder in forum Active Directory
    Replies: 4
    Last Post: 03-06-2010, 11:23 AM
  3. ldap query with guid
    By kyosang in forum Active Directory
    Replies: 2
    Last Post: 17-06-2009, 07:34 PM
  4. LDAP query
    By Palaksi in forum Active Directory
    Replies: 3
    Last Post: 11-12-2008, 02:09 AM
  5. LDAP query can it be done ?
    By zscw1 in forum Active Directory
    Replies: 3
    Last Post: 13-11-2008, 10:08 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,470,565.97827 seconds with 16 queries