473,785 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows groups from a domain

How can I determine the windows groups from a domain?
How can I determine all the windows groups to which a user belongs to?
(WindowsPrincip al says if a user belongs to a specific group. I need a list
with all the groups).
Thanks!
Nov 15 '05 #1
1 4461
You can use the System.Director yServices library to get the user:

DirectoryEntry objUser = new
DirectoryEntry( "WinNT://domain/username,user") ;

you can also use LDAP if it is Win2K, but then you'll need to perform a
search in AD.

The returned directory entry object has a "groups" method that you can
invoke (for the WinNT provider - the LDAP provider has a memberOf property
instead).

Be aware that the groups method and the memberOf property only return the
groups that the user is a direct member of, and does not include nested
groups. For LDAP you'd need to get the tokenGroups property and use the SIDs
returned to get the groups.
Arild

"uiranejeb" <mi************ *@infoworld.ro> wrote in message
news:OW******** ******@tk2msftn gp13.phx.gbl...
How can I determine the windows groups from a domain?
How can I determine all the windows groups to which a user belongs to?
(WindowsPrincip al says if a user belongs to a specific group. I need a list with all the groups).
Thanks!

Nov 15 '05 #2

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

Similar topics

1
2135
by: sherkozmo | last post by:
I have my SQL 7.0 server set for Mixed security. I see now (finally) the advantages of having windows authentication security for windows groups. I do most of my developing in Access Projects which require a login of some type. I have been using my SQL login to develop with SQL and then when I give it to the user, I set the project to use Windows authentication. I want to be able to have Windows authentication on my domain account but...
1
1511
by: howard dierking | last post by:
Hi, I am using local windows groups as roles in an asp.net application. In my web.config file, I have the following: <authentication mode="Windows" /> <authorization> <allow roles="localmachinename\OOK_CDD" /> <deny users="*" /> </authorization>
4
1618
by: Dave | last post by:
Greetings, I have a web application that will be hosted on our intranet. I would like to determine, via code the user's windows login name and domain in the following format: DOMAIN\loginname Is this possible? Thanks, -Dave
6
2147
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
2158
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.
4
7722
by: Gav | last post by:
Hi, I am writing a windows form application (C#) which access's data from an SQL server. The SQL server is using windows authentication only. At the moment I have to grant the domain users access to the database for the application to work. However, the database includes information that I need to hide from the users, currently the application is taking care of that. There is nothing stopping the users from accessing the database in a...
3
1772
by: thomson | last post by:
Hi All, If i log into my windows machine, Iam already authenticated against the AD, Inorder to identify the Groups, Do i need to check the Active Directory once again, or Windows Principal.IsInrole is sufficient. All the developers are using logon to a particular domain and doing the work, IF i access one of my developers machine , through my machine , which credentials it take ,will it take mine or
4
5691
by: shashank kadge | last post by:
hi all, i am trying to get local admin users and groups on a windows server. here is the C# code that i am using *************************************************************************************************** DirectoryEntry AD = new DirectoryEntry("WinNT://" + sServerName + ",Computer",UserName,Password); DirectoryEntry admGroup = AD.Children.Find("Administrators", "Group"); object members = admGroup.Invoke("Members", null); ...
1
1508
by: DK | last post by:
I have an intranet application I've built using asp.net 3.5 / running on IIS6 I want to use BUILTIN groups on the server that contain domain users. So I set up my web.config like so for example: <authorization> <allow roles="BUILTIN\Intranet_Admin"/> <!--<allow roles="GNB\archivesemp"/works--> <!--<allow users="GNB\dking"/works--> <deny users="*"/>
0
10325
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
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
10091
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
8972
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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
5381
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.