473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Trying to access Active Directory from within MOSS gives me error

I am try to get information from AD from within MOSS. My app is
strongly typed, marked as SAFECONTROL in the web.config and the dlls
are in the GAC. But I get this error.

Here is my code (very simple)

public void TestSite()
{
DirectoryEntry AD = new
System.DirectoryServices.DirectoryEntry("LDAP://
OU=SharePointUsers,DC=sharepoint,DC=MyDomain,DC=pr v");

foreach (System.DirectoryServices.DirectoryEntry dir in
AD.Children)
{

Response.Write(dir.Name);

}
}

Here is the error

Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 10/16/2007
Time: 4:36:36 PM
User: N/A
Computer: SRQVSINDY2
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 10/16/2007 4:36:36 PM
Event time (UTC): 10/16/2007 8:36:36 PM
Event ID: 1403d61f0e8b4124b43b432259efd663
Event sequence: 39
Event occurrence: 2
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/215465162/Root-1-128370400524496191
Trust level: WSS_Minimal
Application Virtual Path: /
Application Path: C:\Inetpub\wwwroot\wss\VirtualDirectories\2501\
Machine name: SERVER2

Process information:
Process ID: 5956
Process name: w3wp.exe
Account name: MEME\Chris.Auer

Exception information:
Exception type: COMException
Exception message: An operations error occurred.
Request information:
Request URL: http://server2:2501/FormServerTemplates/spad.aspx
Request path: /FormServerTemplates/spad.aspx
User host address: 10.16.10.159
User: MEME\Chris.Auer
Is authenticated: True
Authentication Type: NTLM
Thread account name: MEME\Chris.Auer

Thread information:
Thread ID: 1
Thread account name: MEME\Chris.Auer
Is impersonating: False
Stack trace: at
System.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsCont ainer()
at
System.DirectoryServices.DirectoryEntries.ChildEnu merator..ctor(DirectoryEntry
container)
at System.DirectoryServices.DirectoryEntries.GetEnume rator()
at ActiveDirectoryWebPart.MyTest.TestSite()
at ActiveDirectoryWebPart.MyTest.Page_Load(Object sender, EventArgs
e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp,
Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object
sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlCollection.Add(Control child)
at SmartPart.SmartPart.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at
System.Web.UI.WebControls.WebParts.WebPart.PreRend erRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

Oct 16 '07 #1
0 1270

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

Similar topics

3
by: CLEAR-RCIC | last post by:
Hi. I have some code that updates a user's account properties in Active Directory. The code also has a call that resets the account password (see code below). I put the code in a .dll and have a...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
3
by: Les Desser | last post by:
In A97 I am trying to determine some attributes of files in a folder - Date, time, file size and file name. To this end I have managed to create a batch file to do a Dir to a work file (and then...
6
by: Frank Wilson | last post by:
Tom, It sounds to me like ASP, not ASP.NET is handling the request for WebForm1.aspx. This is most likely an IIS config issue that may have been caused by order of installation or...
3
by: Rod | last post by:
I've got a Crystal Reports for Visual Studio.NET 2003 that I wrote. Up until now, I have been able to run it just fine, however, I had to change the access method to use Active Directory. (It...
2
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current...
10
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to...
0
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like:...
7
by: thebarefootnation | last post by:
Hi, I have created an access db that I would like to secure. The database will exist on a shared drive and be used at a number of different locations hence the reason to secure the database. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.