User privilege issue logged on user (non local system account)
-
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
-
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
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 -
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 KreskowiakThanks 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
-
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
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