473,395 Members | 1,986 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,395 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 1831
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.