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

List of User/Computer

Hi,
I'm trying to get a list of Users or Computers currently logged into a
domain?
Thanks
Mel
Nov 16 '05 #1
5 6402
See it this helps:

Inventory of Domain Users and Computers Using ADSI
http://www.serverwatch.com/tutorials...le.php/1476791

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Mel Weaver" <Mel@[remove spam]insdirect.com> escribió en el mensaje
news:Ow**************@TK2MSFTNGP10.phx.gbl...
Hi,
I'm trying to get a list of Users or Computers currently logged into a
domain?
Thanks
Mel

Nov 16 '05 #2
Check the System.DirectoryServices namespace. These classes are wrappers
aound ADSI.
Search MSDN for samples (hint DirectoryEntry and DirectorySearcher are the
classes to look at).

Willy.

"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
Hi,
I'm trying to get a list of Users or Computers currently logged into a
domain?
Thanks
Mel

Nov 16 '05 #3
Willy,
I can get a list of users or computer in the domain, using
DirectoryEntry, but I can't find a way to find what computers/users are
currently logged into the domain.

Mel
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:u3*************@TK2MSFTNGP09.phx.gbl...
Check the System.DirectoryServices namespace. These classes are wrappers
aound ADSI.
Search MSDN for samples (hint DirectoryEntry and DirectorySearcher are the
classes to look at).

Willy.

"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
Hi,
I'm trying to get a list of Users or Computers currently logged into a
domain?
Thanks
Mel


Nov 16 '05 #4
Try this.
string sMacName =Environment.MachineName;
string sCurrentUser =Environment.UserDomainName;

Nov 16 '05 #5


"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl...
Willy,
I can get a list of users or computer in the domain, using
DirectoryEntry, but I can't find a way to find what computers/users are
currently logged into the domain.

Mel

Mel,
Oh, sorry, I did mis-read your question.
Finding out precisely who's actually logged on into a domain is difficult
(if not impossible). There is no "central authority" that keeps track of
this.
Each logon server (DC) in a domain keeps track of the established logon
sessions (local and domain) , so when you have multiple domain controllers
(you should have) you will have to query all DC's in the domain to know the
users actually logged-on.
W2K3's WMI classes Win32_LogonSession and Win32_LoggedOnUser can be used to
enumerate the Domain Login's is through System.Management (WMI wrappers).
On W2K DC's you will have to PInvoke the LsaEnumerateLogonSessions and
LsaGetLogonSessionData security API's. Note that you can't do this from a
client, so you will have to provide the session info through a windows
service or (preferably) through a WMI instance provider interface
implemented using .NET.

Willy.
Nov 16 '05 #6

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

Similar topics

5
by: Roger | last post by:
I would like to get a list of running processes on a remote machine. How is this possible via VB.Net? Is it possible? Can someone point me in the right direction. thanks, rog
0
by: Mike Tyndall | last post by:
Whoops, way late this time. Sorry again, things have been hectic. Updates: -Books added to the "Other C++ books" section: Inside the C++ Object Model -Books added to the "General programming"...
2
by: dhnriverside | last post by:
Hi guys I'm trying to create an updated list of which of my AD users are logged onto each computer - there's about 29 computers and we use hotdesking! I'm using Windows Integrated...
1
by: lecnac | last post by:
Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group The...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
18
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...
2
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data...
4
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...
30
ADezii
by: ADezii | last post by:
For this Tip, we will show you an extremely handy, multi-user, feature of Jet that allows you to manage Users more effectively. You can create a special, provider-specific Recordset in ADO that...
4
by: jeet | last post by:
Plz help me.Problem is that On the first page I display all other user with checkbox and give user option to select only two user which he wants to send message. Tell me please how I'll get those...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.