473,385 Members | 1,402 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,385 software developers and data experts.

retrieve only active computers on the domain

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 go into
Server Manager and it displays an active icon next to the computer
indicating that it is logged into the domain. Any help would be
appreciated.

private DirectoryEntry deDOMAIN = new
DirectoryEntry("WinNT://MYDOMAIN");

DirectoryEntries _myDcn = deDOMAIN.Children;

foreach(DirectoryEntry d in _myDcn)
{
if (d.SchemaClassName == "Computer")
treeView1.Nodes[0].Nodes.Add(new TreeNode(d.Name));
}
Nov 16 '05 #1
1 1364
Greg, if you can ip of a host you can check is it active or not.
look at the direction of netapi32 functions like
NetShareEnum, etc..
--
Vladimir Scherbina,
Ukraine, Kiev.
"Greg" <g8*******@msn.com> wrote in message
news:f9**************************@posting.google.c om...
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 go into
Server Manager and it displays an active icon next to the computer
indicating that it is logged into the domain. Any help would be
appreciated.

private DirectoryEntry deDOMAIN = new
DirectoryEntry("WinNT://MYDOMAIN");

DirectoryEntries _myDcn = deDOMAIN.Children;

foreach(DirectoryEntry d in _myDcn)
{
if (d.SchemaClassName == "Computer")
treeView1.Nodes[0].Nodes.Add(new TreeNode(d.Name));
}

Nov 16 '05 #2

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

Similar topics

2
by: Dirk Hagemann | last post by:
Hi! I'm using this code to list all computers of our WinNT-Domains: import win32com.client from pprint import pprint as p domain='domainX' auswahl='computer' def enumerate(domain,auswahl):...
3
by: Dirk Hagemann | last post by:
Hi! I asked here a few weeks ago the same question but the answer of Tim Golden didn't really help yet. I'd like to know how to set up a query for all computer-accounts in a special part of...
1
by: Ollie | last post by:
I know this has been asked before, I have read the answers given and I am unable to get this work ( I don't know that much about AD configuration) I have an asp.net web service that is designed...
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
2
by: Dan | last post by:
All, I need to be able to retrieve a list of Domains that are part of our network: similar to the list you get when you log onto a Windows station that is part of a domain. I assume that I can...
0
by: jakobsgaard | last post by:
It is possible to Map a certificate to a Active Directory User Account from DotNet? Please provide an example. Best regards, Ejnar Jakobsgaard...
10
by: KarlM | last post by:
Hallo! System.Security.AccessControl.FileSecurity (GetAccessControl) works fine. Now I would like to use GetAccessControl for Active Directory Objects like computers. I've searched a lot but...
1
maxamis4
by: maxamis4 | last post by:
Hello folks, Here is the backgroup. I am creating an agent that can find a user in LDAP and return the last logon date. Now i am not sure if with active directory you can user the...
8
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.