Table does not exist error.

W

Wake-Up-Jeff

I am trying to get my asp.net code to modify the comment property of the
user object in AD.
The idea is that an AD user accesses the web page.
The user's credentials are used to access the user object and modify their
own comment field.
I don't want to use a single domain account to do this for all users. Each
user can do it for themselves.
I get the "table does not exist" error when calling the following code:

con = CreateObject("ADODB.Connection")
con.provider = "ADsDSOObject"
con.open("Active Directory Provider")
com = CreateObject("ADODB.Command")
com.ActiveConnection = con
strQuery = "Select distinguishedName from 'LDAP://" & strDomain & "'" & _
" Where objectCategory = 'Person' AND objectClass='user' AND
samAccountName='" & strUserID & "'"
com.commandtext = strQuery
RS = com.Execute

the error occurs on com.Execute.

I have read about impersonation, and have attempted to set this up, but I
obviously haven't got something correct yet.
The authentication for my virtual directory has Integrated Windows
Authentication checked, and no other options checked.
My web.config file has the following entries:
<authentication mode="Windows"/>
<identity impersonate ="true"/>

I have the computer account on which IIS is running as "Trusted for
delegation". It is running W2K3 R2. The domain and forest are both at W2K3
functional level.

Any hints????
 
G

Guest

I am trying to get my asp.net code to modify the comment property of the
user object in AD.
The idea is that an AD user accesses the web page.
The user's credentials are used to access the user object and modify their
own comment field.
I don't want to use a single domain account to do this for all users. Each
user can do it for themselves.
I get the "table does not exist" error when calling the following code:

con = CreateObject("ADODB.Connection")
con.provider = "ADsDSOObject"
con.open("Active Directory Provider")
com = CreateObject("ADODB.Command")
com.ActiveConnection = con
strQuery = "Select distinguishedName from 'LDAP://" & strDomain & "'" & _
           " Where objectCategory = 'Person' AND objectClass='user' AND
samAccountName='" & strUserID & "'"
com.commandtext = strQuery
RS = com.Execute

the error occurs on com.Execute.

I have read about impersonation, and have attempted to set this up, but I
obviously haven't got something correct yet.
The authentication for my virtual directory has Integrated Windows
Authentication checked, and no other options checked.
My web.config file has the following entries:
<authentication mode="Windows"/>
<identity impersonate ="true"/>

I have the computer account on which IIS is running as "Trusted for
delegation". It is running W2K3 R2. The domain and forest are both at W2K3
functional level.

Any hints????

Hi

you need to look into DirectoryServices namespace

The code to modify comments should be something like this

Dim srch As New DirectorySearcher(de)
Dim result As SearchResult

srch.Filter = ("(sAMAccountName=myUserName)")
result = srch.FindOne()
Dim EditDe As DirectoryEntry = New DirectoryEntry
(result.GetDirectoryEntry().Path)
EditDe.Properties("info").Value = "further info"
EditDe.CommitChanges()

Hope this helps
 
G

Guest

He mentioned that this is "asp.net code". I think he just tried to get
VBS working he found somewhere... I gave him right way to follow...
 
W

Wake-Up-Jeff

Pardon my ignorance, but I'm new at this asp.net caper.
I am used to VBScript programming, and that's why the code is what it is.
I'm happy to modify to use the Directory Services namespace, and will give
it a try.
It seems to me however, that the issue is due to Kerberos delegation issues.
The code works fine if I run IIS on a DC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top