DirectoryEntry and Remote Server Webs

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.
 
G

Guest

Anyone have any ideas on this. Another strange thing, a
coworker of mine essentially wrote the same code in C#
and it works fine....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top