Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. User privilege issue logged on user (non local system account)

User privilege issue logged on user (non local system account)

Scheduled Pinned Locked Moved C#
helpworkspace
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sunil P V
    wrote on last edited by
    #1

    Hi, I have a desktop application that is executed with Admin privileges. When this application is run by a non-admin user (by elevating the app with admin rights) say standard user, I am unable to get the standard user's (or logged on user's) environment variables, instead the application returns the Admin users environment variable. How can this issue be resolved. Please help...

    Sunil

    D 1 Reply Last reply
    0
    • S Sunil P V

      Hi, I have a desktop application that is executed with Admin privileges. When this application is run by a non-admin user (by elevating the app with admin rights) say standard user, I am unable to get the standard user's (or logged on user's) environment variables, instead the application returns the Admin users environment variable. How can this issue be resolved. Please help...

      Sunil

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      sunilkpv wrote:

      When this application is run by a non-admin user (by elevating the app with admin rights)

      That's exactly what's supposed to happen. The app will run as the Admin user and get the Admin users variables. You cannot get the logged on users variables as that person did not launch the app and, hence, the app did not inherit the normal users environment.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        sunilkpv wrote:

        When this application is run by a non-admin user (by elevating the app with admin rights)

        That's exactly what's supposed to happen. The app will run as the Admin user and get the Admin users variables. You cannot get the logged on users variables as that person did not launch the app and, hence, the app did not inherit the normal users environment.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        S Offline
        S Offline
        Sunil P V
        wrote on last edited by
        #3

        Thanks Dave. But is there a way to hack this. I want the logged on user's environment variables even though the application is invoked as an admin user. I suppose impersonation would not work because the admin account does not fall under local system account...

        Sunil

        D 1 Reply Last reply
        0
        • S Sunil P V

          Thanks Dave. But is there a way to hack this. I want the logged on user's environment variables even though the application is invoked as an admin user. I suppose impersonation would not work because the admin account does not fall under local system account...

          Sunil

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          No, there's no "hack" for this. What are you doing that requires an admin account? Impersonation won't work because then you're using the users account, which pretty much makes launch as an admin a moot point.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups