Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6203095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:51:14+00:00 2026-05-24T04:51:14+00:00

We are building a rich-client app (WPF) that uses the logged-on user information for

  • 0

We are building a rich-client app (WPF) that uses the logged-on user information for auditing and authorization.

I’m trying to decide between three different APIs for accessing this information:

  • System.Management classes (WMI queries)
  • System.Security.Principal classes (WindowsIdentity, etc)
  • System.DirectoryServices.AccountManagement classes (UserPrincipal, etc)

The use cases are:

  • Get the current username
  • Get all the users in group X
  • Get all the groups the current user belongs to
  • Is the current user in group X?
  • Is user X in group Y?

I have some proofs of concept for each method, but I’d like some objective reasons to use one or other. I’d appreciate facts on the following aspects:

  • Testability
  • Performance
  • Ease of use
  • Ease of deployment
    • In test/production
    • In developer’s computers
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:51:15+00:00Added an answer on May 24, 2026 at 4:51 am

    WMI
    is nice regarding testability because there are many (native/.NET/script…) out there whcih can be used for the same tasks, result comparison etc.
    What in my experience can be rather difficult is deployment/setup regarding security/communication etc.

    System.DirectoryServices.AccountManagement
    In my exeperience very easy to use and deploy… for developer’s computer you can (sacrificing some subtler aspects) use the same code and test it with the local User/Groups if need be. Regarding Performance this is usually more than sufficient but can be tweaked a bit depending of you needs (ad-hoc AD queries versus permanent conn etc.).
    Should there ever be the need to not only query but create/change Users/Groups etc. this is an easy thing to do…

    I didn’t use System.Security.Principal alot so can’t say much about it… the more current part of .NET is System.DirectoryServices.AccountManagement and works really well 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When building an iPhone app that uses the Core Plot framework, I am seeing
I'm building a (CakePHP) website with an admin section that allows rich text editing
Building a client-side swing application what should be notified on a bus (application-wide message
Im building a web application which is a process management app. Several different employee
When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant
In building an ASP.NET 3.5 WAP, I'm always frustrated by the feeling that no
I'm building a system in Node.js that is supposed to find all files in
I'm building a component that is an extension for another software product. It's loaded
I'm building this hotsite that relies heavily on 'heavy' images and animations. It has
Building on How Do You Express Binary Literals in Python , I was thinking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.