Get the list of logged on machines in a domain from within that domain

  • Thread starter Thread starter Eranga
  • Start date Start date
E

Eranga

I want to get the list of computers with users logged on in my domain
using C# as the language .
Can some one of you plese tell me how exactly I can perform this
Thanks in advance
 
Hi there... One easy solution can be

net view > c:\loggedon.txt

at the command prompt and then manipulate the text file any way you want

Regards,
 
Hello Angel,
Thanks for your reply. But I want to use this in a program and feed the
results in to an asp.net web application. Do you think the net view can
be used in that sense.?
Thanks in advance for any helpful comments and tips.
 
Angel J. Hernández M. said:
Hi there... One easy solution can be

net view > c:\loggedon.txt

at the command prompt and then manipulate the text file any way you want

Regards,


--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://www.consein.com

Note that this returns the computers on the network that have their
"Netbios" name broadcasted, that doesn't mean there are currently inteactive
users logged on as asked by OP.

Willy.
 
Eranga said:
Hello Angel,
Thanks for your reply. But I want to use this in a program and feed the
results in to an asp.net web application. Do you think the net view can
be used in that sense.?
Thanks in advance for any helpful comments and tips.

Unless you are running in a domain (be it NT4 or AD), there is no easy way
to know the machines that have users logged on.
If you have a domain infrastructure, you can use System.DirectoryServices to
query the machine names in the domain, when you have a list of machines you
can use System.Management and WMI to query the logon sessions running on
each box individually.

Willy.
 
Thanks for your help
Yes I am workin in the domain it self. I want to get the machines with
users logged on in this domain.what is the method you thought of when
you wrote
"Unless you are running in a domain (be it NT4 or AD), there is no easy
way
to know the machines that have users logged on."
 
Back
Top