tag:support.hglabhq.com,2012-10-18:/discussions/problems/874-ldap-does-not-work-helpHgLab: Discussion 2015-11-05T02:32:19Ztag:support.hglabhq.com,2012-10-18:Comment/383152272015-10-28T10:44:34Z2015-10-28T10:44:34ZLDAP does not work, help<div><p>How to add users ang groups from Active Directory?</p></div>Olegtag:support.hglabhq.com,2012-10-18:Comment/383152272015-11-05T01:13:25Z2015-11-05T01:13:25ZLDAP does not work, help<div><p>We're having the same issue.<br>
Entered our AD settings but not clear how to proceed from
there.<br>
Should our AD Groups show up in Groups ?</p>
<p>Documentation says:<br>
Remember that according to the Security Model, a User must be
granted a "Collaboration" System-level permission. This means that
initially none of your LDAP users will be able to sign in to HgLab.
To grant them access, go to Groups and assign the "Collaboration"
permission to the LDAP Groups you want to give access to HgLab.</p>
<p>This implies that our AD groups should have shown up in Groups
and we activate them by allowing Collaboration? But we're seeing no
AD groups in HgLab Groups</p></div>pdavidsontag:support.hglabhq.com,2012-10-18:Comment/383152272015-11-05T02:32:18Z2015-11-05T02:32:18ZLDAP does not work, help<div><p>Got this working by finding this code sample in here and then
modifying settings until the code ran correctly. Port 636 has been
suggested to work better:</p>
<p>using System;<br>
// Requires a reference to
System.DirectoryServices.AccountManagement using
System.DirectoryServices.AccountManagement;</p>
<p>namespace LdapTroubleshooter<br>
{ class Program { static void Main(string[] args) { var
serverAddress = "yourldapserver.domain.com"; var serverPort =
"636"; var baseContainer = "OU=Listname,dc=example,dc=com"; var
bindLogin = "BindableLogin"; var bindPassword =
"binderpassword";</p>
<pre>
<code> var serverQualifiedAddress = serverAddress;
if (!string.IsNullOrWhiteSpace(serverPort))
serverQualifiedAddress = serverQualifiedAddress + ":" + serverPort;
using (var domainContext = new PrincipalContext(ContextType.Domain, serverQualifiedAddress, baseContainer, ContextOptions.Negotiate, bindLogin, bindPassword))
{
var principal = UserPrincipal.FindByIdentity(domainContext, "yourLoginname");
Console.WriteLine(principal.DistinguishedName);
} // using
}
}</code>
</pre>
<p>}</p></div>pdavidson