Solved

Getting user's NT User Group Name

Posted on 2006-11-27
2
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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