473,433 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,433 software developers and data experts.

DirectoryEntry and Remote Server Webs

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.
Nov 20 '05 #1
1 1832
Anyone have any ideas on this. Another strange thing, a
coworker of mine essentially wrote the same code in C#
and it works fine....
-----Original Message-----
I am trying to enumerate the webs on a remote server
using the DirectoryEntry provider for VB.NET. Here is mycode:

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 itlocally it works fine. Obviously this is a security
issue. I tried setting the oSite objects username and
password, but still no luck.
.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jason | last post by:
What is the best way to handle global includes for 3 subwebs that may at various times consume similiar include files such as ENQUIRY FORMS. I ask this question as I now have the oppportunity to...
7
by: Dave | last post by:
I have two sites: www.site_A.com & www.site_A_news.com Site_A is in d:\webs\site_a & uses an Access DB in d:\webs\site_a\data\db.mdb Site_A_news is in d:\webs\site_a\site_a_news also...
1
by: kenguil | last post by:
I'm hoping that this is the right group to post this to and that someone will have an answer to this. Environment: 1) Laptop joined to domain "foo.com", logged in using cached credentials 2)...
1
by: Chris | last post by:
I am runnig IIS 5.0 on W2k. I am not able to run asp.net pages. Application mappings show all .net extensions and .NET 1.1 is installed. I get the following error:
2
by: a | last post by:
I keep getting this message, "unable to get the project file from the web server" when I try to open a new project that I just copied. I created a virtual director with IIS 5 (VS2002). Trying to...
4
by: Dave | last post by:
I recentlymoved my asp and aspx webs to a new server. The asp webs (developed in InterDev) come up fine. But I get the following message when I try to view my donet asp (aspx) webs: Server...
1
by: John Grandy | last post by:
XP Pro SP2 , IIS 6.0 , various virtual webs already created with web-apps running against those virtual webs : I notice that on the IIS > Default Web Site > Properties > Server Extensions tab...
3
by: Michael | last post by:
Sorry for the newbie question, but if I install the .NET 2.0 redistributables on our ASP.NET server--- - will my old apps continue to work? - will I be able to add 2.0 pages to my old apps? M
4
by: musosdev | last post by:
Hi peeps I've just moved my dev system to Win2k3 / VS2005 (from Win2k/VS2k3) and I'm having a problem. I've setup a new website in IIS, enabled .net, fpse, etc. From VS2005, if I choose...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.