Author: AndyA
Subject: PsExec to launch admin-level task from LU account
Posted: 23 March 2014 at 5:31pm
I've recently converted from XP Pro to Windows 7 Pro (Wn7). Under Wn7, I have an admin account, which will be restricted to software installs, and a Standard (Limited) user (LU) account, which will be used the bulk of the time. For now, I've left UAC at default settings.
Under XP, I also used an LU account. I wrote VBS scripts that, for example, used psexec to enable services, run applications and then disable the services.
I'm trying to set up equivalent scripts under Wn7, but have been unsuccessful so I'm appealing here for help.
All of the scripts are being run locally. Remote access is not an issue. The passwords can be present in the scripts in clear text. There are no local security risks.
All of the scripts are written in VBS, with which I'm very familiar.
Ideally, the script should require no user interaction and present no UAC prompts.
As an example, let's say I'd like to have a script start a service.
The VBS would look like something as follows:
The script should be launched with admin privileges. It does get launched, but without admin privileges. (The script is unable to start a service.)
I've done lots of reading, but I've obviously missed something.
I read the thread about PsExec on Vista.
I found references to cmdkey.
I tried to use a scheduled task, but it turns out that an LU cannot create a Scheduled Task.
I also looked into alternative utilities.
So far, nothing has worked.
If UAC is left enabled, can I use PsExec to launch a script from an LU account with admin privileges? What's the syntax?
TIA.
regards, AndyA
Subject: PsExec to launch admin-level task from LU account
Posted: 23 March 2014 at 5:31pm
I've recently converted from XP Pro to Windows 7 Pro (Wn7). Under Wn7, I have an admin account, which will be restricted to software installs, and a Standard (Limited) user (LU) account, which will be used the bulk of the time. For now, I've left UAC at default settings.
Under XP, I also used an LU account. I wrote VBS scripts that, for example, used psexec to enable services, run applications and then disable the services.
I'm trying to set up equivalent scripts under Wn7, but have been unsuccessful so I'm appealing here for help.
All of the scripts are being run locally. Remote access is not an issue. The passwords can be present in the scripts in clear text. There are no local security risks.
All of the scripts are written in VBS, with which I'm very familiar.
Ideally, the script should require no user interaction and present no UAC prompts.
As an example, let's say I'd like to have a script start a service.
The VBS would look like something as follows:
Dim Wshso : Set Wshso = WScript.CreateObject("WScript.Shell")
Wshso.Run "psexec.exe -h -u my_username_here -p my_password_here " &_
WScript.FullName & " " & """" & path_and_VBS_name_here & """"
The script should be launched with admin privileges. It does get launched, but without admin privileges. (The script is unable to start a service.)
I've done lots of reading, but I've obviously missed something.
I read the thread about PsExec on Vista.
I found references to cmdkey.
I tried to use a scheduled task, but it turns out that an LU cannot create a Scheduled Task.
I also looked into alternative utilities.
So far, nothing has worked.
If UAC is left enabled, can I use PsExec to launch a script from an LU account with admin privileges? What's the syntax?
TIA.
regards, AndyA