473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

windows users

Jim
Hi

I would like to get all the windows users defined in the current domain.
What is the code for this?

ch Jim
Nov 16 '05 #1
10 3498
Using WMI - "Select * from Win32_UserAccou nt" and then look for "FullName"
or "Name" where "Domain" matches.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain.
What is the code for this?

ch Jim

Nov 16 '05 #2
Jim
against which database do i have to run this?

ch Jim
"Sahil Malik" <co************ *****@nospam.co m> schreef in bericht
news:uB******** ******@TK2MSFTN GP15.phx.gbl...
Using WMI - "Select * from Win32_UserAccou nt" and then look for "FullName"
or "Name" where "Domain" matches.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain.
What is the code for this?

ch Jim


Nov 16 '05 #3
You should not use WMI for this, use the System.Director y namespace classes
DirectoryEntry and DirectorySearch er, these are wrappers arround ADSI.
If your domain is AD based (W2K and higer) use the LDAP ADSI provider for
downlevel domains (NT4) you have to use WinNT as provider.
Check following link for samples:

http://msdn.microsoft.com/library/de...e_examples.asp

Willy.
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
against which database do i have to run this?

ch Jim
"Sahil Malik" <co************ *****@nospam.co m> schreef in bericht
news:uB******** ******@TK2MSFTN GP15.phx.gbl...
Using WMI - "Select * from Win32_UserAccou nt" and then look for
"FullName" or "Name" where "Domain" matches.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain.
What is the code for this?

ch Jim



Nov 16 '05 #4
Please set your system clock correctly.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain.
What is the code for this?

ch Jim

Nov 16 '05 #5
Jim
what is the problem with it? it displays the correct time over here

Jim
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:Ok******** ******@TK2MSFTN GP12.phx.gbl...
Please set your system clock correctly.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain.
What is the code for this?

ch Jim


Nov 16 '05 #6
Jim
thanks!

ch Jim
"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:Ot******** ******@TK2MSFTN GP14.phx.gbl...
You should not use WMI for this, use the System.Director y namespace classes DirectoryEntry and DirectorySearch er, these are wrappers arround ADSI.
If your domain is AD based (W2K and higer) use the LDAP ADSI provider for
downlevel domains (NT4) you have to use WinNT as provider.
Check following link for samples:

http://msdn.microsoft.com/library/de...e_examples.asp
Willy.
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
against which database do i have to run this?

ch Jim
"Sahil Malik" <co************ *****@nospam.co m> schreef in bericht
news:uB******** ******@TK2MSFTN GP15.phx.gbl...
Using WMI - "Select * from Win32_UserAccou nt" and then look for
"FullName" or "Name" where "Domain" matches.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain. What is the code for this?

ch Jim



Nov 16 '05 #7
Jim,

It can be as well that your localization setting of your computer is wrong.

Cor
Nov 16 '05 #8
Isn't WMI an alternative? Why shouldn't it be used?

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:Ot******** ******@TK2MSFTN GP14.phx.gbl...
You should not use WMI for this, use the System.Director y namespace classes DirectoryEntry and DirectorySearch er, these are wrappers arround ADSI.
If your domain is AD based (W2K and higer) use the LDAP ADSI provider for
downlevel domains (NT4) you have to use WinNT as provider.
Check following link for samples:

http://msdn.microsoft.com/library/de...e_examples.asp
Willy.
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
against which database do i have to run this?

ch Jim
"Sahil Malik" <co************ *****@nospam.co m> schreef in bericht
news:uB******** ******@TK2MSFTN GP15.phx.gbl...
Using WMI - "Select * from Win32_UserAccou nt" and then look for
"FullName" or "Name" where "Domain" matches.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
"Jim" <pe*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi

I would like to get all the windows users defined in the current domain. What is the code for this?

ch Jim



Nov 16 '05 #9

"Sahil Malik" <co************ *****@nospam.co m> wrote in message
news:uk******** ******@TK2MSFTN GP12.phx.gbl...
Isn't WMI an alternative? Why shouldn't it be used?

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik

Following are a number of reasons not to use WMI for this:
1. Speed. WMI wasn't designed for domain account management tasks,
especially for larger domains it tends to be real slow, Win32_UserAccou nt is
particularly known to affect performance negatively. LDAP based DS where
specially designed to execute such queries real fast.
2. Security. Most domain admins turn off WMI services on DC's, or are
granting access to domain admin only.
3. WMI doesn't have a notion of an AD domain hierarchy and as such is not as
feature rich as AD based DS.
4. Using WMI you have to know the DC to connect to, so it fails if the DC is
not reachable, AD DS automatically finds an alternate DC in the domain if a
connection to the logon DC fails.
5. WMI fails to enumerate other domains in the forest (see 3).

One can say it's an alternative for very small NT4 domains, but as it
doesn't offers any advantage over using the ADSI based "WinNT" provider
interfaces encapsulated by System.Director yServices, I would say stick with
DS even for small NT4 domains.

Willy.

Nov 16 '05 #10

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

Similar topics

16
34543
by: Robert Mark Bram | last post by:
Hi All! Is there a way to reference a window by name without doing something like this: open (, 'windowName'); The open method will open a blank window if there is no window with such a name. I am trying to organise a navigation structure between two windows with content from the same host.. I have been trying the following:
3
2703
by: Nick | last post by:
I am working a new application...well actually a series of applications for my company. They want internal users to be able to go to a site and everything regarding security is transparent, however we will have brokers and customers that also need to connect and will require a username and password. In this case we were going to store their...
1
2587
by: Sean | last post by:
Hi. I'm converting a project which uses windows form UI to Windows service. I just finished converting but I can't use any UI (winform or console). can't Windows Service use UI? then what will be an alternative? help me. :-)
4
3509
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the...
0
3035
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the...
3
7475
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I...
0
1380
by: genzy | last post by:
I'm facing the below problem. With <deny users="?" />, the Windows Login ID is able to be obtained to fill up the Windows IDSID text field automatically, but reading the file info is failed. Without <deny users="?" />, the Windows Login ID is not able to be obtained, but reading the file info is successful. Is there any way to make...
7
1906
by: torus | last post by:
Is the aspnet account called "aspnet" for all non-English versions of Windows and IIS?
30
6946
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table. The problem is, they can't remember the passwords they've created, and I spend more time than I want to resetting. Here's what I'd LIKE to have...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.