Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 10495

Windows command line to run as the currently logged in user after starting command/batch script as another user within the same script?

$
0
0

I have a Windows batch script which is auto run at login as a particular admin user (not the same user that is logged in) for all standard users.

Within the same script, I need to run a check on their group membership (by calling an exe with a specific group as a parameter) on the currently logged in user, i.e. the user who is logged into windows which the script's shell displays and is run from/on.

Then dependant on the outcome of the aforementioned check, continue processing the same script using the initial admin user's rights, i.e. to install software.

Is there any way to do this without asking for credentials, purely through command line or maybe even powershell (called from within the script)?

I'm looking for a completely non-interactive experience for the user as this is to be applied to up to approx. 9000 users.

Any help would be appreciated. Cheers.


Viewing all articles
Browse latest Browse all 10495

Trending Articles