Page 1 of 1

Issue Running with Alternate credentials in Script packager

Posted: Tue Dec 20, 2016 6:14 pm
by UCPocoAPocoToo
Product, version and build:
Version 7.2.97 2016
32 or 64 bit version of product: 64 bit
Operating system: windows 7 64 bit
32 or 64 bit OS: 32 and 64 bit OS (windows 7)

Hi,

I am having an issue with the use of Alternate credentials within the output settings of the packager settings.
Under Alternate credentials I have User name: I input mydomain.com\DomainUserAccount ( This DomainUserAccount is a member of the local administrators group)
Password: I input the password for DomainUserAccount .
Run Mode: is set to current user.

Scrip engine: Sapien PowerShell v5 host (windows)
Target: Microsoft windows 32 bit

when I compile the ps1 script to an exe file, logon to a windows 7 device with a domain user that DOES NOT have administrators rights, launch the compiled exe, I get an error message that says you do not have right to run the script. Its basically running an msi from a network location. If I login the device with an account with administrators privilege, it works without issues. I just can't seem to get the elevation to work. I remember in the past(much older version of the software) I did something like mydomain.com@DomainUserAccount and that worked years ago.
My question is, How do I get the script to run elevated with an account that is part of the local admins group? Am I inputting the username format correctly?

I also tried with the local administrator account as I've seen in the forum localhost\administrator with the correct local administrator's password. that did not work either. Please help.

Thanks in advance.

Re: Issue Running with Alternate credentials in Script packager

Posted: Tue Dec 20, 2016 6:37 pm
by Alexander Riedel
Err, if you select "Current User" for run mode, your user id and password just get ignored. You will need to set either Impersonate or RunAs user to actually have this have an effect.
Depending on you UAC settings this MAY not even be enough and you need a two step process.
Since elevation is evaluated (per manifest) before a process is even started, a "RunAs" would not be executed before the elevation prompt.
So you need one process use RunAs, which gets you from a 'normal' user to the desired user. The another process with an elevation manifest to reach full admin privileges.

Since you are executing MSI files, Windows Installer may do the elevation part for you though.

Re: Issue Running with Alternate credentials in Script packager

Posted: Tue Dec 20, 2016 6:52 pm
by UCPocoAPocoToo
I didn't realize there were other options other than current user. In the past, there was a dropdown with 3 selectable options. However, I had to click on the little down arrow to select impersonate user and that did the trick. My script is working as expected. Thanks you sir!