473,396 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Administrator status

Under XP I used the following code
AppDomain.CurrentDomain.SetPrincipalPolicy(Securit y.Principal.PrincipalPolicy.WindowsPrincipal)
Dim MyPrincipal As
System.Security.Principal.WindowsPrincipal =
CType(System.Threading.Thread.CurrentPrincipal,
System.Security.Principal.WindowsPrincipal)
bgIsAdministrator =
MyPrincipal.IsInRole(System.Security.Principal.Win dowsBuiltInRole.Administrator)

However under Vista this returns false unless the program is
specifically run as an administrator.

I am not interested in that but in the account type (Administrator or
standard). How can I find that out please?

Thanks

Jack Russell
Oct 29 '07 #1
1 1542

"Jack Russell" <ja***@norubbish.tpg.com.auwrote in message
news:OG*************@TK2MSFTNGP03.phx.gbl...
Under XP I used the following code
AppDomain.CurrentDomain.SetPrincipalPolicy(Securit y.Principal.PrincipalPolicy.WindowsPrincipal)
Dim MyPrincipal As
System.Security.Principal.WindowsPrincipal =
CType(System.Threading.Thread.CurrentPrincipal,
System.Security.Principal.WindowsPrincipal)
bgIsAdministrator =
MyPrincipal.IsInRole(System.Security.Principal.Win dowsBuiltInRole.Administrator)

However under Vista this returns false unless the program is specifically
run as an administrator.

I am not interested in that but in the account type (Administrator or
standard). How can I find that out please?
I think you're going to have to start following new security principles with
Vista.

<copied out of the link>
http://www.jimmah.com/vista/Security/uac.aspx
When UAC mode is enabled, every program that you run will be given only
"standard user" access to the system, even when you are logged in as an
administrator. There are only 2 ways that a program can be "elevated" to get
full admin access to the system:

a.. If it automatically asks you for permission when it starts up, and you
click Continue
b.. If you start the program with permission by right-clicking it, then
clicking Run As Administrator
A program either starts with STANDARD rights or, if you give permission,
ADMINISTRATOR rights, and once the program is running it cannot change from
one to the other.

If a program that you have already started with admin powers starts another
program, that program will automatically be given admin powers without
needing your permission. For example, if you start the command prompt as
administrator, and then start notepad from that command prompt, notepad WILL
ALSO automatically run WITH admin powers, and will not ask for permission.

<end copy>

Vista has tossed out what was being done the previous versions of the NT
classed O/S(s), and the reason why it's doing it that is being talked about
in the link, when it comes to security.

http://blogs.zdnet.com/Ou/?p=785

Oct 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben | last post by:
Hello all, I have googled every thing that I can think of but I can't seem to find what I'm looking for. What I need is a daily log system for system administrators. It needs to be able to...
2
by: Simple Java Drinker | last post by:
I decided to reinstall the Windows XP on my computer by using the Repair Option. After typing "R" as required I am requested to input an administrator password. The problem is that no administrator...
2
by: Pat | last post by:
Hi, I installed Mysql Administrator with file mysql-administrator-1.0.22a-1.rh9.src.rpm from the mysql-site on my RedHat 9.0 computer I did: rpm -Uvh mysql-administrator-1.0.22a-1.rh9.src.rpm...
7
by: phillip.s.powell | last post by:
We're looking at a GUI interface for our MySQL DB and I am interested in MySQL Administrator, however, one of our requirements is to be able to import/export databases. Is this possible or do I...
2
by: Vadim | last post by:
Hi! I imported some table (about 1500 records) using "LOAD DATA LOCAL INFILE..." (command line console). No warnings, no skipped, no deletes - all the recored are written to be imported. However,...
5
by: rdemyan via AccessMonster.com | last post by:
I would like to have my application add administrative tasks to an Administrator's Outlook Task Folder. I know how to get the User group of the CurrentUser and think I can even code how to do the...
1
by: grabro | last post by:
Having just upgraded to from Suse 10.0 to 10.1 mysql-administrator will not work. When I try to acccess it I get the following message. linux:/home/grabro # mysql-administrator...
8
by: =?Utf-8?B?TWFydGluIFNhY2hz?= | last post by:
I have been using MSCONFIG (XP Pro) for four years with no problem. I always use it in Administrator. Last night, when I attempted to go into selective startup mode, I got the following error...
5
by: =?Utf-8?B?TWFyZ2ll?= | last post by:
I use XP Home Edition, am the administrator and have recently run into many problems. They seem to center around not being able to properly function as the computer administrator. For example,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.