1

I have developed a windows application in C# .net. I need to check given user name has admin privilege in the machine. In Vista, if user doesnot run the application as "Run as admin", the admin role check with windows identity will return false.

Could you please help me to check given user name has admin in the nachine?

2 Answers2

0

I think you'll find this related question useful:

How can I tell if my process is running as Administrator?

Be sure to follow the links on the accepted answer for an additional potentially-related solution.

Community
  • 1
  • 1
kbrimington
  • 25,142
  • 5
  • 62
  • 74
0

It's not EXACTLY what you asked, but I think this is where you need to go with this... If you want to guarantee that the user has admin privileges, see this article: http://community.bartdesmet.net/blogs/bart/archive/2006/10/28/Windows-Vista-2D00-Demand-UAC-elevation-for-an-application-by-adding-a-manifest-using-mt.exe.aspx

However, I would strongly urge you to try to develop your app so that admin privileges are not needed. There's a good article here: http://searchwindevelopment.techtarget.com/tip/0,289483,sid8_gci1341781,00.html

It requires registration,l but it's free and it is a good site.

David
  • 72,686
  • 18
  • 132
  • 173