Solved

Getting user's NT User Group Name

Posted on 2006-11-27
2
208 Views
Last Modified: 2010-04-16
Hi,

I'm trying to retrieve the NT user group that the user running my application belongs to. I've been retrieving the domain name and user name using the code below and I was wondering is there some similar way of getting the user's NT user group:

//Get the domain of the current user
string domainname = System.Environment.UserDomainName;

//Get the user name
string username = System.Environment.UserName;

Any help would be appreciated,

Thanks
0
Comment
Question by:GlobexCorp
2 Comments
 
LVL 1

Accepted Solution

by:
surferxyz2 earned 500 total points
ID: 18018975
You can check the user against known Windows group names by using
WindowsPrincipal's IsInRole method. Retrieving unknown group names
(which sounds like the case here) may pose more of a problem for you. If
you're on a Win2K network you may have access to Active Directory
services, and you could then take advantage of the functionality offered
by the System.Directory namespace. Without Active Directory I believe
your answer becomes more elusive (maybe others can offer potential
solutions in this case).


See this.
http://www.csharphelp.com/archives2/archive440.html
0
 
LVL 2

Author Comment

by:GlobexCorp
ID: 18038356
Found my solution. Thanks for the suggestion anyway.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question