I need to get all group name and its description (of which user is member and also those groups which don't have user). The connection to the external domain has to be trough LDAP with port 389 and with user's credential.
For now I am able to validate the user by using below code:
public string UserValidation(string username, string domain, string password, string url)
{
var credentials = new NetworkCredential(username, password, domain);
var serverId = new LdapDirectoryIdentifier(url);
LdapConnection connection = new LdapConnection(serverId, credentials);
string result = "true";
try
{
connection.Bind();
}
catch (Exception e)
{
result = e.ToString();
}
connection.Dispose();
return result;
}
This link helps to get groups but not for external domain.