Obtain IIS Children

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a problem to obtain the children in IIS when I create a folder
directly in c:\inetput\wwwroot\*. If a create with Visual Studio it's OK.
This is the code I use to obtain the object IIS.

Dim objAdmnIIS As System.DirectoryServices.DirectoryEntry
Dim colctRepert As String()
Dim objRpertEnf As System.DirectoryServices.DirectoryEntry
Dim objRpertParen As System.DirectoryServices.DirectoryEntry
Dim strNomRpert As String
Dim blnRpertTrouv As Boolean

objAdmnIIS = New System.DirectoryServices.DirectoryEntry( _
String.Format("IIS://{0}/W3SVC/{1}/Root{2}", _
"Serveur", _
"1"_
String.Empty))

objAdmnIIS.RefreshCache()

objRpertParen = objAdmnIIS

If Not colctRepert Is Nothing Then
For Each strNomRpert In colctRepert
blnRpertTrouv = False
For Each objRpertEnf In objRpertParen.Children
If
objRpertEnf.Name.ToUpper().Equals(strNomRpert.ToUpper()) Then
objRpertParen = objRpertEnf
blnRpertTrouv = True
Exit For
End If
Next
Next
End If

Thank You
 
Hello Martin,

the IIS metabase only contains entries for websites and virtual directories.
But if you create a new folder under InetPub\wwwroot, I wouldn't expect it
to show up in the metabase. For IIS, this is only a simple subdirectory
without any configuration data on it. Now, when you configure a
web-application on the subfolder, an entry would be created in the metabase.

Best regards,
Henning Krause
 
Back
Top