Well, the problem I'am having now applies to web applications only.
Therefore, I believe it has something to do with security settings. Here's
the code:
-------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim child As System.Director yServices.Direc toryEntry
' dirEntry is a DirectoryEntry component that points to
' WinNT://someserver
' I tried to retrieve the current user Active Directory information by
' using the Find function and specifying the logon userId and which
' schema the user belongs to. In this case, "User"...
child = dirEntry.Childr en.Find(getCurr entUserId, "User")
' lb is a ListBox
lb.DataSource = child.Propertie s()
End Sub
Public Function getCurrentUserI d() As String
' I attempt to retrieve the current user windows logon id with the
' domain name removed using a Spilt("/") but it returns an empty
' string instead
Return
System.Security .Principal.Wind owsIdentity.Get Current.Name.Sp ilt("/")(1)
End Function
-------------------------------------------------------------------
After launching the site, the following error occurs:
-------------------------------------------------------------------
[COMException (0x80004005): Unspecified error
]
System.Director yServices.Inter op.IAdsContaine r.GetObject(Str ing
className, String relativeName) +0
System.Director yServices.Direc toryEntries.Fin d(String name, String
schemaClassName )
ADSearch.WebFor m1.Page_Load(Ob ject sender, EventArgs e) in c:\inetpub\
wwwroot\ADSearc h\WebForm1.aspx .vb:36
System.Web.UI.C ontrol.OnLoad(E ventArgs e)
System.Web.UI.C ontrol.LoadRecu rsive()
System.Web.UI.P age.ProcessRequ estMain()
-------------------------------------------------------------------
I've tried using only the windows logon userId(dirEntry .Children.Find
(getCurrentUser Id)) to retrieve the Active Directory entry for the current
user but the error still comes back.
I'am at my wits end...
solutions anyone?
--
Message posted via http://www.dotnetmonster.com