Administrator status

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack Russell

    Administrator status

    Under XP I used the following code


    AppDomain.Curre ntDomain.SetPri ncipalPolicy(Se curity.Principa l.PrincipalPoli cy.WindowsPrinc ipal)
    Dim MyPrincipal As
    System.Security .Principal.Wind owsPrincipal =
    CType(System.Th reading.Thread. CurrentPrincipa l,
    System.Security .Principal.Wind owsPrincipal)
    bgIsAdministrat or =
    MyPrincipal.IsI nRole(System.Se curity.Principa l.WindowsBuiltI nRole.Administr ator)

    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
  • Mr. Arnold

    #2
    Re: Administrator status


    "Jack Russell" <jackr@norubbis h.tpg.com.auwro te in message
    news:OGxt2ZcGIH A.280@TK2MSFTNG P03.phx.gbl...
    Under XP I used the following code
    >
    >
    AppDomain.Curre ntDomain.SetPri ncipalPolicy(Se curity.Principa l.PrincipalPoli cy.WindowsPrinc ipal)
    Dim MyPrincipal As
    System.Security .Principal.Wind owsPrincipal =
    CType(System.Th reading.Thread. CurrentPrincipa l,
    System.Security .Principal.Wind owsPrincipal)
    bgIsAdministrat or =
    MyPrincipal.IsI nRole(System.Se curity.Principa l.WindowsBuiltI nRole.Administr ator)
    >
    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>

    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.



    Comment

    Working...