my system admin gave me this:
Domain : capp.net USER : capp\dhr2
Pass : admin@12345
what will the connection string be?
I am very very new to adfs. So i tried this:
<add name="ADConnectionString"
connectionString="LDAP://capp.net/CN=dhr,DC=capp,DC=net" />
<authentication mode="Forms">
<forms name=".ADAuthCookie" timeout="43200"/>
</authentication>
<authorization>
</authorization>
<membership>
<providers>
<clear/>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider"
connectionUsername="cn=dhr2"
connectionPassword="admin@12345"
connectionStringName="ADConnectionString"/>
</providers>
</membership>
I am always getting this error: Unable to establish secure connection with the server
I am doing someting wrong with the connection string. I just dont know how to fix it.
Whenever I've accessed AD from .net I've done the following:
var directoryEntry = new DirectoryEntry("LDAP://capp.net");
directoryEntry.Username = "capp\dhr2";
directoryEntry.Password = "admin@12345";
Then you can query "AD" using the DirectorySearcher.
var directorySearcher = new DirectorySearcher(directoryEntry);
...
Thanks to everyone for your help and support. The correct address in my case was:
LDAP://192.168.0.146/CN=USERS,DC=capp,DC=net
What i didnt realize in the beginning was that i was trying to connect to Active Directory in a different domain than my current domain. So the Ip address was the missing part. thanks a million to Luis who realized that there was something wrong was with the domain.
And thanks Shadow Walker for explaining the ldap connection string in more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With