Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Facing problem while accessing data from Active Directory

Facing problem while accessing data from Active Directory

Scheduled Pinned Locked Moved ASP.NET
helpsysadminwindows-admincsharpasp-net
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bishwambhar_sen
    wrote on last edited by
    #1

    Hi all, One Page of my ASP.NET application uses an active directory search to fetch the list of users. The Problem is : This page works fine all day long but sometimes throws an error "The server is not operational". This error disappears when the IIS is reset, but appears again after 2 or 3 hrs.I am unable to find out the reason behind this.I am sending you the details I found in the event Viewer: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 4/15/2009 6:23:17 AM Event time (UTC): 4/15/2009 1:23:17 PM Event ID: dbd99a355e4f451da4fd7e4f50e0f8e1 Event sequence: 21 Event occurrence: 6 Event detail code: 0 Application information: Application domain: /LM/W3SVC/399023246/Root/Mail-14-128842748654050392 Trust level: Full Application Virtual Path: /Mail Application Path: C:\Inetpub\wwwroot\EnhancementSite\Mail on myip\ Machine name: mymachinename Process information: Process ID: 2380 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: COMException Exception message: The server is not operational. Request information: Request URL: http://mydomain.com/Mail/newmail.aspx Request path: /Mail/newmail.aspx User host address: mydomain.com User: username Is authenticated: True Authentication Type: NTLM Thread account name: NT AUTHORITY\NETWORK SERVICE Thread information: Thread ID: 5 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll() at GetAllUsers.getUsers.getUsername(DropDownList dduserlist) at Mail.newmail.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) kindly help me find a permanent solution to this problem as iisreset is not a very good option. Thanks Vasillis_zayetsav

    T 1 Reply Last reply
    0
    • B bishwambhar_sen

      Hi all, One Page of my ASP.NET application uses an active directory search to fetch the list of users. The Problem is : This page works fine all day long but sometimes throws an error "The server is not operational". This error disappears when the IIS is reset, but appears again after 2 or 3 hrs.I am unable to find out the reason behind this.I am sending you the details I found in the event Viewer: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 4/15/2009 6:23:17 AM Event time (UTC): 4/15/2009 1:23:17 PM Event ID: dbd99a355e4f451da4fd7e4f50e0f8e1 Event sequence: 21 Event occurrence: 6 Event detail code: 0 Application information: Application domain: /LM/W3SVC/399023246/Root/Mail-14-128842748654050392 Trust level: Full Application Virtual Path: /Mail Application Path: C:\Inetpub\wwwroot\EnhancementSite\Mail on myip\ Machine name: mymachinename Process information: Process ID: 2380 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: COMException Exception message: The server is not operational. Request information: Request URL: http://mydomain.com/Mail/newmail.aspx Request path: /Mail/newmail.aspx User host address: mydomain.com User: username Is authenticated: True Authentication Type: NTLM Thread account name: NT AUTHORITY\NETWORK SERVICE Thread information: Thread ID: 5 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll() at GetAllUsers.getUsers.getUsername(DropDownList dduserlist) at Mail.newmail.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) kindly help me find a permanent solution to this problem as iisreset is not a very good option. Thanks Vasillis_zayetsav

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      Try this... Replace the values for user and active directory group. DirectoryEntry ent = new DirectoryEntry(appSettings.domain, appSettings.user, appSettings.password, AuthenticationTypes.ReadonlyServer); DirectorySearcher srch = new DirectorySearcher(ent, "(CN=" + activeDirectoryGroup + ")"); SearchResult obj = srch.FindOne(); DirectoryEntry dr = new DirectoryEntry(obj.Path, appSettings.user, appSettings.password); foreach (object ob in (IEnumerable)dr.Invoke("members")) { DirectoryEntry obGpEntry = new DirectoryEntry(ob); //Put your code here. }

      I didn't get any requirements for the signature

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups