M
Mike
I am trying to enumerate the webs on a remote server
using the DirectoryEntry provider for VB.NET. Here is my
code:
Try
Dim SelNode As String =
TreeConfig.SelectedNode.Text
Dim oSite As New
DirectoryServices.DirectoryEntry("IIS://" & SelNode
& "/W3SVC")
oSite.RefreshCache()
Dim oEntry As New
DirectoryServices.DirectoryEntry
For Each oEntry In oSite.Children
If oEntry.SchemaClassName
= "IIsWebServer" Then
MessageBox.Show(oEntry.Invoke
("Get", "ServerComment"))
End If
Next
Catch ex As Exception
MessageBox.Show("Enum Err: " &
ex.Message, "Enumeration Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
When I run it on a remote server I get the message "A
security package specific error occurred". When I run it
locally it works fine. Obviously this is a security
issue. I tried setting the oSite objects username and
password, but still no luck.
using the DirectoryEntry provider for VB.NET. Here is my
code:
Try
Dim SelNode As String =
TreeConfig.SelectedNode.Text
Dim oSite As New
DirectoryServices.DirectoryEntry("IIS://" & SelNode
& "/W3SVC")
oSite.RefreshCache()
Dim oEntry As New
DirectoryServices.DirectoryEntry
For Each oEntry In oSite.Children
If oEntry.SchemaClassName
= "IIsWebServer" Then
MessageBox.Show(oEntry.Invoke
("Get", "ServerComment"))
End If
Next
Catch ex As Exception
MessageBox.Show("Enum Err: " &
ex.Message, "Enumeration Error", MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
When I run it on a remote server I get the message "A
security package specific error occurred". When I run it
locally it works fine. Obviously this is a security
issue. I tried setting the oSite objects username and
password, but still no luck.