Results 1 to 2 of 2

Thread: DirectoryServices

  1. #1
    Join Date
    Dec 1969

    Default DirectoryServices

    Hi <BR><BR>I have been trying to use the directory services to enable me to file a list box with a list of all the virtual directories in the default web site.<BR>I have been using the code shown below which i got from a tutorial.<BR><BR>Private Sub GetChildren(ByVal objParent As DirectoryServices.DirectoryEntry)<BR><BR> Dim objChildren As DirectoryServices.DirectoryEntries = objParent.Children<BR><BR> Dim objChild As DirectoryServices.DirectoryEntry<BR> <BR> For Each objChild In objChildren<BR><BR> If objChild.SchemaClassName = "IIsWebVirtualDir" Then<BR><BR> lstVirtualDirectories.Items.Add(objChild.Path.Subs tring(intPos + 1))<BR><BR> End If<BR><BR> GetChildren(objChild)<BR><BR> Next<BR><BR> End Sub<BR><BR>When i try to run the code it errors on the line " For Each objChild In objChildren". Saying Access Denied.<BR><BR>I have tried setting then directory entry directly by using the code shown below.<BR><BR>Dim objDirEnt As System.DirectoryServices.DirectoryEntry = New DirectoryEntry("IIS://localhost/W3SVC/1/Root/test")<BR> <BR>lblSummary.Text = objDirEnt.Name<BR><BR>This errors on the line<BR><BR>lblSummary.Text = objDirEntry.Name<BR><BR>I have sett the allow anonymous user property on the default directory but i still get the error.<BR><BR>Has any one used the DirectoryServices and experienced the same problem or know why i am getting the access denied error please let me know<BR><BR>Cheers<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: DirectoryServices

    I am not 100% sure, but in the final release microsoft made some heavy changes to the security. You need to give the ASP.NET user the rights, and then it should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts