473,493 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

List Domain Computers

Hello,

I have a simple bit of code which I have found in the forums which lists all
the computer(s) in a domain.

The code is: DirectoryEntry domainEntry = new
DirectoryEntry("WinNT://DOMAIN");
domainEntry.Children.SchemaFilter.Add("computer");
foreach(DirectoryEntry server in domainEntry.Children)
computers.Add(server.Name);

(where computers is an ArrayList)
When executed from within a console application I get the expected results
however I want to show
the list in a drop down list on an asp.net page.

When I put the code in my asp.net page, the dropdown list box always remains
empty.
Is this a permissions problem? Any suggestion how I can remedy this problem
would be gratefully appreciated.

Regards
Lloyd
Nov 18 '05 #1
1 2670
Hi,

I solved this by using Impersonation

"Lloyd Taylor" <ll**********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hello,

I have a simple bit of code which I have found in the forums which lists all the computer(s) in a domain.

The code is: DirectoryEntry domainEntry = new
DirectoryEntry("WinNT://DOMAIN");
domainEntry.Children.SchemaFilter.Add("computer");
foreach(DirectoryEntry server in domainEntry.Children)
computers.Add(server.Name);

(where computers is an ArrayList)
When executed from within a console application I get the expected results
however I want to show
the list in a drop down list on an asp.net page.

When I put the code in my asp.net page, the dropdown list box always remains empty.
Is this a permissions problem? Any suggestion how I can remedy this problem would be gratefully appreciated.

Regards
Lloyd

Nov 18 '05 #2

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

Similar topics

1
1367
by: Greg | last post by:
I am using the following code to obtain all computers in my domain. This returns all computers ever created in the domain. I would like to only get currently active computers. Sort of like when you...
1
2457
by: Piotrek Stachowicz | last post by:
Hi, I'd like to display list of all MS SQL servers which are available on the network (I write application which uses database located on one of the machines in my LAN). Has anyone got any idea...
5
6403
by: Mel Weaver | last post by:
Hi, I'm trying to get a list of Users or Computers currently logged into a domain? Thanks Mel
4
1814
by: Peter Steele | last post by:
I've found some VB code to query a domain controller to return the list of all computers in that domain. The VB code is reasonably straightforward (see below). How do I do the equivalent in C++?...
3
3851
by: Steve | last post by:
Hi all How would i get a list of all Active Computers on a network? All I need are the computer names. Kind Regards, Steve.
0
2023
by: Joao Correia via DotNetMonster.com | last post by:
Hello all, This is my first post in this forum My problem is: I have to list all domains, computers, users and groups here...we have some domains, plus 20.000 computers (with NT/4, XP and...
18
2434
by: Vic Spainhower | last post by:
Hello, Can someone tell me why on some computers the following list will fail . I have a user reported that some of the links in the below list will fail and some will work. The ones that fail...
4
7659
by: JB | last post by:
I am trying to get a list of all the active computers running on my domain. I'm writing some remote management style software with WMI, which works fine when i know the computer name, but i just...
8
3811
Plater
by: Plater | last post by:
I hope I can explain this correctly. BACKGROUND: My office has a local network. We use a windows server 2003(small business server i think) computer to handle our domain. So all of our employees...
0
7119
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
6989
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
7195
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
7367
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...
0
5453
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,...
1
4889
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
4579
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
3088
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
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.