473,668 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading users and user groups

Hi.

I'm trying to read all the users and user groups from the NT domain I'm
connected to.
I cnat't se how this should be done. Can anyone help me.

I'm basically trying to link my users to the domain user's! I'll keep track
of my applications
user rigts but with the NT Domain users..

Thanks

Bjorn.

Nov 15 '05 #1
1 2562
Use the DirectoryServic es namespace with the WinNT provider for NT4.0
domain, and LDAP for Win2K domain with Active Directory.

DirectoryEntry objDomain = new DirectoryEntry( "WinNT://domain")
foreach(Directo ryEntry objChild in objDomain.Child ren) {
if(objChild.Sch emaClassName == "user") {
// This is a user
}
}

Or something like that for NT 4.0 (not tested or compiled). For Win2K use
the LDAP://rootDSE to get the name of the domain naming context and use the
DirectorySearch er class to find all users.
Arild

"Bjorn Kristensen" <no****@yahoo.c om> wrote in message
news:eB******** *****@TK2MSFTNG P12.phx.gbl...
Hi.

I'm trying to read all the users and user groups from the NT domain I'm
connected to.
I cnat't se how this should be done. Can anyone help me.

I'm basically trying to link my users to the domain user's! I'll keep track of my applications
user rigts but with the NT Domain users..

Thanks

Bjorn.

Nov 15 '05 #2

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

Similar topics

19
10308
by: Lionel B | last post by:
Greetings, I need to read (unformatted text) from stdin up to EOF into a char buffer; of course I cannot allocate my buffer until I know how much text is available, and I do not know how much text is available until I have read it... which seems to imply that multiple reads of the input stream will be inevitable. Now I can correctly find the number of characters available by: |
4
2084
by: MLH | last post by:
A97: If I create a new user with CreateUser Method, is she automatically a member of Users group? Or, do I have to append her to that group?
0
1529
by: James | last post by:
Hello All, I am working in a Windows NT domain environment, working with C#. What I want to be able to do is view all the groups a user belongs to, and also be able to add the users to groups. I want to be able to enter a user name and then get it to diaplay all the groups this user belongs to. Are the groups a user belongs to stored as child entries under the user, or are users child entries under groups, or am I way off track.
3
9875
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't seem to get this to work in VB.Net. Here's what I have: OLD ASP Code: Function Get_ADS_Users_For_Group(ADS_Path) Dim Group_Information Dim Error_Number
1
3890
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://domain") Dim mySearcher As New DirectorySearcher(enTry) Dim resEnt As SearchResult mySearcher.Filter = ("(objectClass=*)") mySearcher.SearchScope = SearchScope.Subtree
6
2138
by: Mr Newbie | last post by:
Hi, Im in a situation where I need to restrict users, but I dont have access or wont be allowed access to manage groups in the domain. How can I restrict access is this case ? -- Best Regards
2
2150
by: Jr. BTS dev! | last post by:
Hello all, In my web app I want to authenticate users using the Windows NT user Groups they blong to. The app will be used internally. Users will all belong to the same domain Users are separated by groups In more details I want to know if the user is administrator, users, customer service (a windows group i create) and so on. I tried using Request.LogonUserIdentity.Groups but did not result in what I want.
6
1964
by: google | last post by:
I have a few general questions. I am working on a new database to be used within my company. I would like to give a couple of people, particularly HR, the ability to add and delete Access users, and add/remove them to groups, so as people join and leave the company, they can be added/removed as database users at that time. However, I don't want them to have to do it through the standard Access users/groups interface, and I don't want...
1
5443
by: Erick Perez - Quadrian Enterprises, S.A. | last post by:
Hi, I have a MS Windows AD domain, and have one OU with more tan 1000 users objects. When I try to read it, I hit the 1000 limit of AD while returning objects, so I'm asking for advice as to how to read them. Here is my actual code, it is not the cleanest as I am learning python. Suggestions are welcomed :) Runnig this script on RedHat 5.x with "python zimbra2.py" returns: {'info': '', 'desc': 'Size limit exceeded'}
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8797
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8583
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8656
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5681
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.