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

  • Home
  • SEARCH
  • 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 8486411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:56:20+00:00 2026-06-10T20:56:20+00:00

I am developing a C# application that needs to detect whether the user is

  • 0

I am developing a C# application that needs to detect whether the user is running as elevated administrator. I tried the solution suggested by Steven.

I checked the solution on 5 machines and it works fine on 4 of them.

There is one machine that never show the UAC notification message, even though I set the User Account Control to Always notify me.

When checking the code on that machine, even if I choose run as administrator, it doesn’t work and the method IsProcessElevated returns false.

Is something wrong with that specific machine?

Is there a way to determine whether a user is elevated or not, on that kind of platform?

  • 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-06-10T20:56:22+00:00Added an answer on June 10, 2026 at 8:56 pm

    After a research I found out that from Windows 7 and on in order to determine whether a user is an elevated admin or not you just need to check the following:

    WindowsIdentity identity = WindowsIdentity.GetCurrent();
    WindowsPrincipal principal = new WindowsPrincipal(identity);
    return principal.IsInRole (WindowsBuiltInRole.Administrator);
    

    (The rest of the code that checks the Token can be used in case this option fails)
    I tested the code on some of the machines and it works ok.

    my application runs only on win7 and above so this solution is good enough for me.

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

Sidebar

Related Questions

I'm developing a small utility application that needs to detect whether another one has
I am developing an application for iOS that needs to detect when the user
I'm developing an application that needs to perform some processing on the user's Outlook
I'm developing a Ruby on Rails application that needs to allow the user to
What ? I am developing a Console Application that needs to keep running 24/7
I am developing a application that needs to store data with many writes and
I am developing an application that needs to inform users (around 1800) on a
Hi I am developing an application that needs to work with a complex domain
I am developing an application that needs to read back the whole frame from
I'm developing a C++ application that needs a GUI. I would like to use

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.