473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem querying LDAP and/or Active Directory

Hey all,

Working on revamping our Intranet here and making use of the LDPA, Active
Directory, Directory Services, etc. that .Net provides. I am still fairly
new on this subject, so the problem I have run into I am not sure how to
fix, and really not sure what is causing it.

Here's what is going on (test server - Windows 2003 Server):
I have a page in a folder (under anonymous authentication in IIS6) that has
a link on it that redirects the user to a page in a folder that is set to
use Integrated Windows Authentication but not anonymous. When redirected,
the IIS security setting forces the user to log in. Now, in the code of
this "login page" I get the user name via
"Context.User.I dentity.Name.To String" and store that to a Session Variable.
I found a bit of code that queries the LDAP server for the full name of a
user
(http://www.411asp.net/func/content?t.../usermana&id=3
972310) which I have put into a class file. After storing the user name, I
set the properties and query the LDAP server, using the function of that
class file, for the user's Full Name. I then save the full name to a
Session Variable as well. The last thing the page does is redirect back to
the starting page. Back on the starting page I then display the contents of
the user and full name Session Variables.
The point here is so I can keep my pages set to Anonymous under II6, but if
I can "authentica te" the visitor, then I can have the code-behind page "turn
on" extra features and what not. Other wise, the page comes up in normal
mode.

My problem...
This all works just fine as long as I am viewing the page from a browser on
the test box. When I fire up a browser on my machine and navigate to the
page on the test box, it errors out. The error is occurring on the second
page described above. I save the error message to a Session Variable and
display that variable's contents back on the first page if an error
occurred. This is the error I get:

System.Runtime. InteropServices .COMException (0x80072020): An operations
error occurred
at System.Director yServices.Direc toryEntry.Bind( Boolean throwIfFail)
at System.Director yServices.Direc toryEntry.Bind( )
at System.Director yServices.Direc toryEntry.get_A dsObject()
at System.Director yServices.Direc torySearcher.Fi ndAll(Boolean
findMoreThanOne )
at System.Director yServices.Direc torySearcher.Fi ndAll()
at WinAuth.Auth.ad si.GetUserProps () in
c:\inetpub\wwwr oot\WinAuth\ads i.vb:line 66
at WinAuth.index.P age_Load(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WinAuth\log in\index.aspx.v b:line 35

I need help here understanding what is going on and why this is happening.
I am thinking it is a permissions issue...in that when I am on the test box,
I can run stuff, but when viewing from a remote box I can't. Or could it be
trying to query the LDAP box from a remote machine? I am at a bit of a loss
here.

Your help is greatly appreciated.

-- Andrew

[Code Segment]

** First Page HTML **
----------------------------------------------------------
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="ind ex.aspx.vb"
Inherits="WinAu th.index1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>index</title>
<meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
<meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
</HEAD>
<body style="MARGIN: 0px">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="5" width="100%"
border="0">
<TR>
<TD vAlign="top" noWrap align="center" width="125">
<P><asp:label id="lblStatus" runat="server"
Visible="false" ></asp:label><br>
<asp:linkbutt on id="lnkLogin" runat="server"
Visible="false" >Please Log In</asp:linkbutton> <asp:label id="lblName"
runat="server" Visible="false" ></asp:label></P>
</TD>
<TD vAlign="top" width="100%">
<DIV align="center"> <asp:label id="Label2" runat="server"
Font-Bold="True" Font-Size="18pt"
Font-Names="Tahoma"> Welcome</asp:label></DIV>
<P align="justify" >&nbsp;&nbsp;&n bsp;&nbsp;Lorem ipsum dolor sit
amet,
consectetuer adipiscing elit. Praesent consequat porta sapien.
Fusce eleifend
urna sit amet justo. Nunc pellentesque justo vel neque. Donec
nonummy ante vel
metus. In aliquam vehicula leo. Curabitur metus. Donec arcu
orci, ultrices ac,
rutrum id, hendrerit vel, tellus. Duis lobortis malesuada
odio. Proin sed enim.
Proin vitae turpis. Integer mollis. Aenean ac quam. Quisque
vulputate purus sit
amet risus.
<br>
</P>
<div align="right">< asp:linkbutton id="lnkEdit" runat="server"
Visible="false" >Edit Text</asp:linkbutton> </div>
</TD>
</TR>
</TABLE>
<div align="center" style="width:50 0px;">
<p align="justify" >
<asp:Label id="lblError" runat="server"
Visible="false" ></asp:Label>
</p>
</div>
</form>
</body>
</HTML>
----------------------------------------------------------

** First Page Code-Behind **
----------------------------------------------------------
Public Class index1
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents lblStatus As System.Web.UI.W ebControls.Labe l
Protected WithEvents Label2 As System.Web.UI.W ebControls.Labe l
Protected WithEvents lnkEdit As System.Web.UI.W ebControls.Link Button
Protected WithEvents lnkLogin As System.Web.UI.W ebControls.Link Button
Protected WithEvents lblName As System.Web.UI.W ebControls.Labe l
Protected WithEvents lblError As System.Web.UI.W ebControls.Labe l

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
Select Case UserIsKnown()
Case False
lblStatus.Text = "Anonymous User"
lblStatus.Visib le = True
lnkLogin.Visibl e = True
Case True
Response.Write( "<!-- Session(""FullN ame""): " &
Session("FullNa me") & " -->" & ControlChars.Ne wLine)
Response.Write( "<!-- Session(""UserN ame""): " &
Session("UserNa me") & " -->" & ControlChars.Ne wLine)
Dim FullName As String = Session("FullNa me")
Dim UserName As String = Session("UserNa me")
lblStatus.Text = "Welcome Back!"
lblStatus.Visib le = True
lblName.Text = FullName
lblName.Visible = True
lnkEdit.Visible = True
End Select
If Not Session("Error" ) Is Nothing Then
lblError.Text = "<PRE>" & ControlChars.Ne wLine &
Session("Error" ) & "</PRE>"
lblError.Visibl e = True
End If
End If
End Sub

Private Function UserIsKnown() As Boolean
If Session("Logged In") Is Nothing Then Session("Logged In") = False
Return (Context.User.I dentity.IsAuthe nticated Or
Session("Logged In"))
End Function

Private Sub lnkLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles lnkLogin.Click
Response.Redire ct("/WinAuth/Login/", True)
End Sub
End Class

----------------------------------------------------------

** Second Page HTML **
----------------------------------------------------------
No HTML was added to default "new page html"
----------------------------------------------------------

** Second Page Code-Behind **
----------------------------------------------------------
Public Class index
Inherits System.Web.UI.P age
Private cADSI As New Auth.adsi

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Context.User.Id entity.IsAuthen ticated Then
Try
Session("Logged In") = True
Session("UserNa me") = Context.User.Id entity.Name.ToS tring
Session("UserNa me") =
Session("UserNa me").Substring( Session("UserNa me").IndexOf("\ ") + 1)
With cADSI
.AD_ServerName = "pdcdns"
.AD_ServiceProv ider = "LDAP"
.AD_UserName = Session("UserNa me")
Session("FullNa me") = .GetUserProps()
End With
If Session("FullNa me") = "" Then
Session("Logged In") = False
End If
Catch ex As Exception
Session("Logged In") = False
Session("Error" ) = ex.ToString
End Try
End If
Response.Redire ct("/WinAuth/", True)
End Sub

End Class

----------------------------------------------------------

** Class File **
----------------------------------------------------------
'// Example By James Arceri
'// Please send comments or questions to: ja*****@starion .com
'// Code taken from:
http://www.411asp.net/func/content?tree=41 1asp/tutorial/howto/usermana&id=397 2310
Imports System
Imports System.Director yServices
Imports System.Text

Namespace Auth

' Active Directory Services Interfaces
Public Class adsi

Private mvar_AD_ServerN ame As String
Private mvar_AD_Service Provider As String
Private mvar_AD_UserNam e As String

' Active Directory server name
Public Property AD_ServerName() As String
Get
Return mvar_AD_ServerN ame
End Get
Set(ByVal Value As String)
mvar_AD_ServerN ame = Value
End Set
End Property

' Active Directory Service provider
Public Property AD_ServiceProvi der() As String
Get
Return mvar_AD_Service Provider
End Get
Set(ByVal Value As String)
mvar_AD_Service Provider = Value
End Set
End Property

' Active Directory username
Public Property AD_UserName() As String
Get
Return mvar_AD_UserNam e
End Get
Set(ByVal Value As String)
mvar_AD_UserNam e = Value
End Set
End Property

' Gets the info for a specific user
' Currently only supports Lightweight Directory Access Protocol
(LDAP) binding
Public Function GetUserProps() As String
Try
Dim strUserName As Array = Split(mvar_AD_U serName, "\", -1,
1)
Dim strFullName As String
Dim sPath As String
Dim objDirEnt As New
DirectoryServic es.DirectoryEnt ry(mvar_AD_Serv iceProvider & "://" &
mvar_AD_ServerN ame)
Dim objSearcher As New
System.Director yServices.Direc torySearcher(ob jDirEnt)
Dim objSearchRes As System.Director yServices.Searc hResult
objSearcher.Fil ter = ("(anr=" & strUserName(0) & ")")
For Each objSearchRes In objSearcher.Fin dAll
sPath = objSearchRes.Ge tDirectoryEntry .Path
Next
objDirEnt.Close ()
objDirEnt.Path = sPath
strFullName = objDirEnt.Invok e("GET", "Name")
Return strFullName
Catch ex As Exception
Throw
End Try
End Function

End Class

End Namespace
----------------------------------------------------------
Nov 18 '05 #1
1 4753
> I need help here understanding what is going on and why this is happening.
I am thinking it is a permissions issue...in that when I am on the test box, I can run stuff, but when viewing from a remote box I can't. Or could it be trying to query the LDAP box from a remote machine? I am at a bit of a loss here.
Hard to answer, Andy. Is the remote machine a member of the same domain as
the machine on which you're testing? Are you using machine-level AD or
domain-level? In an Active Directory domain, you would want to be querying
the domain's Active Directory, not the local machine's. In addition, if you
want to get the currently logged-on user, that user must have had to log on
to the web site without using Anonymous access. IOW, you need to require a
domain login for the web site on which this app is running, so that the
client must log in with domain credentials instead of anonymous credentials.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Andrew" <An********@hot mail.com> wrote in message
news:OZ******** ******@TK2MSFTN GP09.phx.gbl... Hey all,

Working on revamping our Intranet here and making use of the LDPA, Active
Directory, Directory Services, etc. that .Net provides. I am still fairly
new on this subject, so the problem I have run into I am not sure how to
fix, and really not sure what is causing it.

Here's what is going on (test server - Windows 2003 Server):
I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that redirects the user to a page in a folder that is set to
use Integrated Windows Authentication but not anonymous. When redirected,
the IIS security setting forces the user to log in. Now, in the code of
this "login page" I get the user name via
"Context.User.I dentity.Name.To String" and store that to a Session Variable. I found a bit of code that queries the LDAP server for the full name of a
user
(http://www.411asp.net/func/content?t.../usermana&id=3 972310) which I have put into a class file. After storing the user name, I set the properties and query the LDAP server, using the function of that
class file, for the user's Full Name. I then save the full name to a
Session Variable as well. The last thing the page does is redirect back to the starting page. Back on the starting page I then display the contents of the user and full name Session Variables.
The point here is so I can keep my pages set to Anonymous under II6, but if I can "authentica te" the visitor, then I can have the code-behind page "turn on" extra features and what not. Other wise, the page comes up in normal
mode.

My problem...
This all works just fine as long as I am viewing the page from a browser on the test box. When I fire up a browser on my machine and navigate to the
page on the test box, it errors out. The error is occurring on the second
page described above. I save the error message to a Session Variable and
display that variable's contents back on the first page if an error
occurred. This is the error I get:

System.Runtime. InteropServices .COMException (0x80072020): An operations
error occurred
at System.Director yServices.Direc toryEntry.Bind( Boolean throwIfFail)
at System.Director yServices.Direc toryEntry.Bind( )
at System.Director yServices.Direc toryEntry.get_A dsObject()
at System.Director yServices.Direc torySearcher.Fi ndAll(Boolean
findMoreThanOne )
at System.Director yServices.Direc torySearcher.Fi ndAll()
at WinAuth.Auth.ad si.GetUserProps () in
c:\inetpub\wwwr oot\WinAuth\ads i.vb:line 66
at WinAuth.index.P age_Load(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WinAuth\log in\index.aspx.v b:line 35

I need help here understanding what is going on and why this is happening.
I am thinking it is a permissions issue...in that when I am on the test box, I can run stuff, but when viewing from a remote box I can't. Or could it be trying to query the LDAP box from a remote machine? I am at a bit of a loss here.

Your help is greatly appreciated.

-- Andrew

[Code Segment]

** First Page HTML **
----------------------------------------------------------
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="ind ex.aspx.vb"
Inherits="WinAu th.index1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>index</title>
<meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
<meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
</HEAD>
<body style="MARGIN: 0px">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="5" width="100%"
border="0">
<TR>
<TD vAlign="top" noWrap align="center" width="125">
<P><asp:label id="lblStatus" runat="server"
Visible="false" ></asp:label><br>
<asp:linkbutt on id="lnkLogin" runat="server"
Visible="false" >Please Log In</asp:linkbutton> <asp:label id="lblName"
runat="server" Visible="false" ></asp:label></P>
</TD>
<TD vAlign="top" width="100%">
<DIV align="center"> <asp:label id="Label2" runat="server"
Font-Bold="True" Font-Size="18pt"
Font-Names="Tahoma"> Welcome</asp:label></DIV>
<P align="justify" >&nbsp;&nbsp;&n bsp;&nbsp;Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Praesent consequat porta sapien. Fusce eleifend
urna sit amet justo. Nunc pellentesque justo vel neque. Donec nonummy ante vel
metus. In aliquam vehicula leo. Curabitur metus. Donec arcu
orci, ultrices ac,
rutrum id, hendrerit vel, tellus. Duis lobortis malesuada
odio. Proin sed enim.
Proin vitae turpis. Integer mollis. Aenean ac quam. Quisque
vulputate purus sit
amet risus.
<br>
</P>
<div align="right">< asp:linkbutton id="lnkEdit" runat="server"
Visible="false" >Edit Text</asp:linkbutton> </div>
</TD>
</TR>
</TABLE>
<div align="center" style="width:50 0px;">
<p align="justify" >
<asp:Label id="lblError" runat="server"
Visible="false" ></asp:Label>
</p>
</div>
</form>
</body>
</HTML>
----------------------------------------------------------

** First Page Code-Behind **
----------------------------------------------------------
Public Class index1
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents lblStatus As System.Web.UI.W ebControls.Labe l
Protected WithEvents Label2 As System.Web.UI.W ebControls.Labe l
Protected WithEvents lnkEdit As System.Web.UI.W ebControls.Link Button
Protected WithEvents lnkLogin As System.Web.UI.W ebControls.Link Button
Protected WithEvents lblName As System.Web.UI.W ebControls.Labe l
Protected WithEvents lblError As System.Web.UI.W ebControls.Labe l

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
Select Case UserIsKnown()
Case False
lblStatus.Text = "Anonymous User"
lblStatus.Visib le = True
lnkLogin.Visibl e = True
Case True
Response.Write( "<!-- Session(""FullN ame""): " &
Session("FullNa me") & " -->" & ControlChars.Ne wLine)
Response.Write( "<!-- Session(""UserN ame""): " &
Session("UserNa me") & " -->" & ControlChars.Ne wLine)
Dim FullName As String = Session("FullNa me")
Dim UserName As String = Session("UserNa me")
lblStatus.Text = "Welcome Back!"
lblStatus.Visib le = True
lblName.Text = FullName
lblName.Visible = True
lnkEdit.Visible = True
End Select
If Not Session("Error" ) Is Nothing Then
lblError.Text = "<PRE>" & ControlChars.Ne wLine &
Session("Error" ) & "</PRE>"
lblError.Visibl e = True
End If
End If
End Sub

Private Function UserIsKnown() As Boolean
If Session("Logged In") Is Nothing Then Session("Logged In") = False
Return (Context.User.I dentity.IsAuthe nticated Or
Session("Logged In"))
End Function

Private Sub lnkLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles lnkLogin.Click
Response.Redire ct("/WinAuth/Login/", True)
End Sub
End Class

----------------------------------------------------------

** Second Page HTML **
----------------------------------------------------------
No HTML was added to default "new page html"
----------------------------------------------------------

** Second Page Code-Behind **
----------------------------------------------------------
Public Class index
Inherits System.Web.UI.P age
Private cADSI As New Auth.adsi

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Context.User.Id entity.IsAuthen ticated Then
Try
Session("Logged In") = True
Session("UserNa me") = Context.User.Id entity.Name.ToS tring
Session("UserNa me") =
Session("UserNa me").Substring( Session("UserNa me").IndexOf("\ ") + 1)
With cADSI
.AD_ServerName = "pdcdns"
.AD_ServiceProv ider = "LDAP"
.AD_UserName = Session("UserNa me")
Session("FullNa me") = .GetUserProps()
End With
If Session("FullNa me") = "" Then
Session("Logged In") = False
End If
Catch ex As Exception
Session("Logged In") = False
Session("Error" ) = ex.ToString
End Try
End If
Response.Redire ct("/WinAuth/", True)
End Sub

End Class

----------------------------------------------------------

** Class File **
----------------------------------------------------------
'// Example By James Arceri
'// Please send comments or questions to: ja*****@starion .com
'// Code taken from:
http://www.411asp.net/func/content?tree=41 1asp/tutorial/howto/usermana&id=397 2310 Imports System
Imports System.Director yServices
Imports System.Text

Namespace Auth

' Active Directory Services Interfaces
Public Class adsi

Private mvar_AD_ServerN ame As String
Private mvar_AD_Service Provider As String
Private mvar_AD_UserNam e As String

' Active Directory server name
Public Property AD_ServerName() As String
Get
Return mvar_AD_ServerN ame
End Get
Set(ByVal Value As String)
mvar_AD_ServerN ame = Value
End Set
End Property

' Active Directory Service provider
Public Property AD_ServiceProvi der() As String
Get
Return mvar_AD_Service Provider
End Get
Set(ByVal Value As String)
mvar_AD_Service Provider = Value
End Set
End Property

' Active Directory username
Public Property AD_UserName() As String
Get
Return mvar_AD_UserNam e
End Get
Set(ByVal Value As String)
mvar_AD_UserNam e = Value
End Set
End Property

' Gets the info for a specific user
' Currently only supports Lightweight Directory Access Protocol
(LDAP) binding
Public Function GetUserProps() As String
Try
Dim strUserName As Array = Split(mvar_AD_U serName, "\", -1, 1)
Dim strFullName As String
Dim sPath As String
Dim objDirEnt As New
DirectoryServic es.DirectoryEnt ry(mvar_AD_Serv iceProvider & "://" &
mvar_AD_ServerN ame)
Dim objSearcher As New
System.Director yServices.Direc torySearcher(ob jDirEnt)
Dim objSearchRes As System.Director yServices.Searc hResult
objSearcher.Fil ter = ("(anr=" & strUserName(0) & ")")
For Each objSearchRes In objSearcher.Fin dAll
sPath = objSearchRes.Ge tDirectoryEntry .Path
Next
objDirEnt.Close ()
objDirEnt.Path = sPath
strFullName = objDirEnt.Invok e("GET", "Name")
Return strFullName
Catch ex As Exception
Throw
End Try
End Function

End Class

End Namespace
----------------------------------------------------------

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4925
by: Dave | last post by:
Hello. I am trying to update attributes in LDAP/Active directory from my application that is written in VB.NET. I am using Directory Services to do so. I do not get any errors during the execution of the code but directory is not being updated. I think it has something to do with caching. I do not understand how directory services library handles it. Can someone please help. Here is the sample of my code: Try...
3
2485
by: Marshall | last post by:
I appear to be having a problem similar to Neil as posted at http://msdn.microsoft.com/newsgroups/Default.aspx?query=directoryentry+intermittent&dg=&cat=en-us-msdn-dotnet&lang=en&cr=US&pt=&catlist=DEA2432D-EA76-4E5B-AF80-E56902048BAD%2C774F24A2-F71F-425F-AC2B-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us I thought my problem was solved when I changed the bind statement to use a specific username/password like: DirectoryEntry entry = new...
4
2101
by: Marc | last post by:
So I am having some issues with code written by another developer that interfaces with Active Directory. We had a catastrophic failure on the server and had to recreate the AD. No the following code does not work: DirectoryEntry ou = new DirectoryEntry("LDAP://ou=WISDM,dc=WISDM,dc=wisdm,dc=org", "username", "password"); // Use the Add method to add a user in an organizational unit. DirectoryEntry usr = ou.Children.Add("CN=" +...
4
4658
by: pjdouillard | last post by:
Hello all, Here is the context of my problem: We have an ASP.NET 1.1 application that has its own application pool setup and that runs under the identity of a NT Domain service account (this is for security reason when accessing databases). We use the Integrated Windows authentication to authenticate users, and we have setup the Web.config file to authenticate those users against 3 NT Domain Global Groups. Everything is working fine...
0
1155
by: Filip De Backer | last post by:
Hi everyone, I've got a web sirvice which checks a user in the LDAP. When I run the service local on my PC it works fine (VS debugger). The user is found in the active direcrory. But when I run the service on the server, it doesn't find the user in the directory. thanks in advance,
3
11302
by: Lucky | last post by:
Hi guys, after long long time. i'm back again with another problem. this time i think the problem is very very interesting and i really need you help on this. i'm trying to connect to the Active Directory. for that i've added one linked server to connect to the active directory. and then query like this: adding linked server:
0
1139
by: msnews.microsoft.com | last post by:
Hello, I need to write an application that will span its transactions between SqlServer and Active Directory. Is it possible to wrap it in one transaction? Thanks, Sanja
1
2892
by: srimanmca | last post by:
Hi, How to get the users list from foreignsecurityprincipal in active directory/ Dev Env : C# / Vb.Net Any help would be greatly appreciated. Regards, Sri
0
1378
by: jc | last post by:
I'm attempting this code: using System; using System.Collections.Generic; using System.Text; using System.DirectoryServices; namespace cLDAP { public class Program
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.