I have done a small active directory application and it is working fine in my testing environment. However, When I put it on the production server, it is throwing following erro
Main Error: Logon failure: unknown user name or bad password.
1.) I am able to ping the mail server (where active directory is in) and can map a drive
2.) The webserver is in the VM ware
3.)I am using directory service logging method to connect as following
Dim RootDSE As New DirectoryServices.DirectoryEntry("LDAP://0.0.0.111/rootDSE")
Dim DomainDistinguishedName As String = RootDSE.Properties("DefaultNamingContext").Value
Dim ADEntry As New DirectoryServices.DirectoryEntry("LDAP://0.0.0.111/ou=abcd Employees," & DomainDistinguishedName)
ADEntry.Username = "administrator"
ADEntry.Password = "abcdef
Is there any problem with my coding to connect? Please help me on this
Dim RootDSE As New DirectoryServices.DirectoryEntry("LDAP://mail.local.abcdefgh.com/rootDSE", "user", "pwd", AuthenticationTypes.Secure)
Dim DomainDistinguishedName As String = RootDSE.Properties("DefaultNamingContext").Value
Dim ADEntry As New DirectoryServices.DirectoryEntry("LDAP://mail.local.abcdefgh.com/rootDSE," & DomainDistinguishedName)
ADEntry.Username = "user"
ADEntry.Password = "pwd"
All I added is AuthenticationType.secure and user login details. Apart from this I added "<identity impersonate="true"/>" in my web.config file
Marked as answer by Raj10 on May 18, 2010 06:05 PM
Raj10
Member
10 Points
25 Posts
Website is not able to connect to Active Directory
May 18, 2010 01:55 PM|LINK
Hi All,
I have done a small active directory application and it is working fine in my testing environment. However, When I put it on the production server, it is throwing following erro
Main Error: Logon failure: unknown user name or bad password.
Stack Trace :[DirectoryServicesCOMException (0x8007052e): Logon failure: unknown user name or bad password.
]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +636
System.DirectoryServices.DirectoryEntry.Bind() +36
System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
System.DirectoryServices.PropertyValueCollection.PopulateList() +25
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +93
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +132
IntranetApps.ContactInfo.Button1_Click(Object sender, EventArgs e) in C:\Work\IntranetApps\IntranetApps\contact_info.aspx.vb:846
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +104
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5614
1.) I am able to ping the mail server (where active directory is in) and can map a drive
2.) The webserver is in the VM ware
3.)I am using directory service logging method to connect as following
Dim RootDSE As New DirectoryServices.DirectoryEntry("LDAP://0.0.0.111/rootDSE") Dim DomainDistinguishedName As String = RootDSE.Properties("DefaultNamingContext").Value Dim ADEntry As New DirectoryServices.DirectoryEntry("LDAP://0.0.0.111/ou=abcd Employees," & DomainDistinguishedName) ADEntry.Username = "administrator" ADEntry.Password = "abcdefIs there any problem with my coding to connect? Please help me on this
Active Directory loging problem
Raj10
Member
10 Points
25 Posts
Re: Website is not able to connect to Active Directory
May 18, 2010 06:05 PM|LINK
Finally, I managed to find the solution by myself
This is the code
Dim RootDSE As New DirectoryServices.DirectoryEntry("LDAP://mail.local.abcdefgh.com/rootDSE", "user", "pwd", AuthenticationTypes.Secure) Dim DomainDistinguishedName As String = RootDSE.Properties("DefaultNamingContext").Value Dim ADEntry As New DirectoryServices.DirectoryEntry("LDAP://mail.local.abcdefgh.com/rootDSE," & DomainDistinguishedName) ADEntry.Username = "user" ADEntry.Password = "pwd"All I added is AuthenticationType.secure and user login details. Apart from this I added "<identity impersonate="true"/>" in my web.config file