Click here to Skip to main content
Licence 
First Posted 24 Nov 2002
Views 62,808
Downloads 1,360
Bookmarked 44 times

Logon Account Permissions Checker

By Vasudevan Deepak Kumar | 24 Nov 2002
This is a simple class/demo application that shows how to check whether the account that is being used to run the application has administrative rights.
5 votes, 83.3%
1

2

3
1 vote, 16.7%
4

5
1.31/5 - 7 votes
μ 1.31, σa 2.14 [?]

Introduction

Many a times, when we write a simple application that accesses some system resources and if Local Security Policy needs administrative rights to run the application, then our application would just crash. For simple testing purposes too, using a MSI installer would be an involved process. Perhaps a small class to automatically check for administrative privileges of the logged on account or the account that is being used to run the application (using the RunAs utility) would be really helpful in these circumstances.

Solution

In .NET, investigating the account's principal, logged on name etc. is just a breeze. System.Security namespace has dozens of utilities and classes that really helps in getting the thing done like in the current context, checking whether the account has administrative rights etc.

Additions

The class that checks the account roles has been kept separate in the accompanying demo file from the application, since we can in the future add facilities like checking for roles, permissions and more granular level operations can be incorporated over there.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Vasudevan Deepak Kumar

Web Developer

India India

Member
Vasudevan Deepak Kumar is from Chennai, India who has been in the programming career since 1994, when he was 15 years old. He has his Bachelors of Engineering (in Computer Science and Engineering) from Vellore Engineering College (now VIT University). He also has a MBA in Systems from Alagappa University, Karaikudi, India.


He started his programming career with GWBasic and then in his college was involved in developing programs in Fortran, Cobol, C++. He has been developing in Microsoft technologies like ASP, SQLServer 2000. For sometime, he has also been with PHP and MySQL based development in one of his previous organizations. Now currently his focus is on Microsoft .NET World (ASP.NET, C# and Whidbey)


In his past-time, he listens to polite Carnatic Music.

Web Presence


Homepage

http://www.lavanyadeepak.tk/

Blogs



Technical




Gossips



Spiritual







Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralNice Demo PinmemberGevik Babakhani14:10 25 Nov '02  
QuestionWhy not? PinmemberMatthew Adams5:28 25 Nov '02  
AnswerRe: Why not? PinmemberDeepak Kumar Vasudevan5:33 25 Nov '02  
GeneralRe: Why not? PinmemberMatthew Adams6:03 25 Nov '02  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120210.1 | Last Updated 25 Nov 2002
Article Copyright 2002 by Vasudevan Deepak Kumar
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid