Re: Code works in Windows app. but not in ASP.Net



This depends a great deal on the actual value of the path you are using.
Can you show that?

Note also that since your code does not supply credentials to the
DirectoryEntry, you will be using the current security context in ASP.NET to
connect to AD. That will nearly always be different there than in a console
app, so different results are to be anticipated.

Joe K.

"Rolf Barbakken" <notnoisy@xxxxxxxxxxxxx> wrote in message
news:upATsukUGHA.5808@xxxxxxxxxxxxxxxxxxxxxxx
I get this error in the webbrowser:
"The specified domain either does not exist or could not be contacted"

The code for the procedure is:
Sub ListUsers(ByVal DOMAIN As String, ByVal OU As String)
Dim srch As System.DirectoryServices.DirectorySearcher
Dim result As System.DirectoryServices.SearchResult
Dim de, dir As System.DirectoryServices.DirectoryEntry

de = New System.DirectoryServices.DirectoryEntry("LDAP://"; & DOMAIN
& "/" & OU)
srch = New System.DirectoryServices.DirectorySearcher(de)
srch.Filter = "(&(objectClass=user)(objectCategory=person))"

For Each result In srch.FindAll()
dir = result.GetDirectoryEntry
txtTest.Text = txtTest.Text &
dir.Properties("distinguishedName").Value & vbCrLf
Next
End Sub

I use the exact same code and the exact same call to the procedure in a
test Windows-app with no problems. So I am guessing some rights problem.
Which rights are needed and which user needs them?

Thanks.


--
_________________
Rolf @ Questus ans




.



Relevant Pages

  • Code works in Windows app. but not in ASP.Net
    ... "The specified domain either does not exist or could not be contacted" ... Dim srch As System.DirectoryServices.DirectorySearcher ... I use the exact same code and the exact same call to the procedure in a test ... So I am guessing some rights problem. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Messagebox displaying without being called
    ... This is AFAIK the exact text you'll have if you ... Dim o As Object=dt.DefaultView' Get the first DataRowView ... formatting happens) but for now I would say rather user code as what you ... exception is thrown. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Singles to Doubles
    ... Dim d1 As Double ... The best representation of a value as a single can use all 24 bits of mantissa, ... In the string domain the value is exact, and can be converted to a double using all 53 bits of precision. ...
    (microsoft.public.vb.general.discussion)
  • Re: Method or Data Member Not Found, but definitely there
    ... > dim v as variant ... > BTW: ... >> structured in the exact same way, ...
    (microsoft.public.access.modulesdaovba)
  • Re: VLookup Function in VB
    ... You are correct I did want it to be exact. ... dim Res as variant ... dim VlookupRng as range ... Sub TEST() ...
    (microsoft.public.excel.programming)