I am using
VB.Net/ASP.net to create a web application which retrive user entries from Windows 2003 Active Directory via ADODB.
I encounter some problems and will greatly appreciate any help.
THANK YOU VERY MCUH in advance.
Q1. I have problem to create a ASP.net web app remotely. I use the
VB.net in my dev box (W2000 system) and try to create the ASP.net web app project in a remote W2003 server. I keep receiving "Unable to create Web Prject "ResetPro". The UNC share \\servername\wwwroot$\ResetPro'does not exist or you do not have access.
I am a domain admin of the domain the W2003 resides. I have created a virtual directory at \\servername\wwwroot$\ResetPro and grand myself a full control.
Q2. I am able to create the ASP.net web app locally. Can I create such ASP.net web app locally and then copy all files over to the remote W2003 server. I tried, but it didn't work.
Q3. I use
VB.net to create ASP.net web app locally. The code mainly works, but the code with ADODB as below first hits "invalid active directory path name was passed" when the search filter as "<LDAP://servername/ou=people,dc=corp,dc=xxx,dc=com>;(samaccountname=x xx);cn;subtree)".
I did some research and notice that "/" in the search filter may cause the error of "invalid active directory path name was found".
I then modify the search filter to be "<LDAP://servername;(samaccountname=xxx);cn;subtree)". With this filter, I receive no error, but no entries returned. The same code code with
VB.net for a window application and returns the entry.
I then use
VB.net debug version to dump the variable "results". It shows
" Bookmark <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred> Object"
Status <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred> Integer"
At the
ADODBRecordSet attributes.
THe code is as below:
Dim sPrefix As String = "LDAP://servername"
results = CreateObject("ADODB.Recordset")
conn = CreateObject("ADODB.Connection")
comm = CreateObject("ADODB.Command")
conn.Provider = "ADsDSOObject"
conn.Open("Active Directory Provider")
comm.ActiveConnection = conn
sSearchFilter = "<" & sPrefix & ">;" & "(sAMAccountName=" & LogonName & ")" & ";distinguishedname,cn;subtree"
comm.CommandText = sSearchFilter
results = comm.Execute
Thanks again!!!
Leey