Skip to content

Unable to perform the cross domain forest user search. #522

@chapcoder

Description

@chapcoder

Hi ,
i have the forest setup forest1 ( ex1.local) and forest2 (ex2.local) . i have created bidirectional trust between these two.
when i created bind with user in ex1.local and perform the search of user in the ex2.local im getting 0 results.
two approaches i followed:

  1. Connection ex1.local as global catalog with port 3268. once bind successful i perform the search with empty baseDN
    searchRequest := ldap.NewSearchRequest(
    "", // The base dn is empty for GC server
    ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
    fmt.Sprintf("(&(objectClass=organizationalPerson)(displayName=%s))", "denis"), // The filter
    []string{"dn", "cn", "displayName"}, // A list attributes to retrieve
    nil,
    )
    this returning only the user present in the ex1.local . denis is present in the ex2.local also but that user details is not getting retrieved.
  2. Get the Trust partner details of ex1.local and perfrom the user search in the ex2.local using the fetched trust details.
    but its giving 0 results.
    searchRequest := ldap.NewSearchRequest(
    "DC=ex1,DC=local", // The base dn to search
    ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
    "(objectClass=trustedDomain)", // The filter to apply
    []string{"trustPartner", "trustDirection", "trustType"}, // A list attributes to retrieve
    nil,
    )
    this gives the trustpartner (ex2.local), trustType:2 , trustDirection:3
    using this detial im perfroming user search, but i am getting 0 results
    userSearchRequest := ldap.NewSearchRequest(
    "DC=ex2,DC=local", // The base dn to search
    ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
    "(&(objectClass=user)(cn=usrtest))", // The filter to apply
    []string{"cn", "mail", "memberOf"}, // A list attributes to retrieve
    nil,
    )
    3)use the Trust DistinguishName detail in the baseDN . I have fetched using the powershell command in the ex1.local AD **Get-ADTrust -Filter *** . but getting zero results.
    userSearchRequest := ldap.NewSearchRequest(
    "CN=ex2.local,CN=System,DC=ex1,DC=local", // The base dn to search
    ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
    "(&(objectClass=user)(cn=usrtest))", // The filter to apply
    []string{"cn", "mail", "memberOf"}, // A list attributes to retrieve
    nil,
    )

Please let me know does go-ldap is not supported yet for cross domain search ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions