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
Bookmarks