EXE Packager Alt Credentials Not Working?

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 14 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
dcdelgado
Posts: 40
Last visit: Tue Feb 17, 2015 9:29 am

EXE Packager Alt Credentials Not Working?

Post by dcdelgado »

Hi All,I am testing the exe packager with alt credentials and i can't get it to work?, please see my below screen shots, i cant get the alt credentials to run on a users pc with no admin rights?Edit: Sorry can't send the screenshots and i don't have sufficient permissions to do so, On the Gen tab i have filled in all the details and checked the "Sapien powershell host command line" and selected the "Embed a default manifest for elevation"Folders tab i have left as c:temp Security tab, i have put in my username "username@msad" then my password, the use runas tab is greayed out?.Files tab i have selected the ps1 script to run.dcdelgado2009-06-23 07:01:11
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

EXE Packager Alt Credentials Not Working?

Post by Alexander Riedel »

Well, that's a bit of a double entendre, using alternate credentials AND elevation. It quite depends on the target platform and what you want to do.

If you want to PROMPT for credentials, elevation is the right thing to use under Vista and above.
If you want to use impersonation, using alternate credentials is what you should use.

You can email you screenshots to support@sapien.com, maybe that gives me a better understanding what you are trying to do. Please include target platform and what type of network (peer, domain).

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
dcdelgado
Posts: 40
Last visit: Tue Feb 17, 2015 9:29 am

EXE Packager Alt Credentials Not Working?

Post by dcdelgado »

Yes i wish to Impersonate, but the runas is grayed out?
User avatar
dcdelgado
Posts: 40
Last visit: Tue Feb 17, 2015 9:29 am

EXE Packager Alt Credentials Not Working?

Post by dcdelgado »

Any ideas?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

EXE Packager Alt Credentials Not Working?

Post by Alexander Riedel »

There are two methods of doing this.
One is to use impersonation, for which you only need to specify a userid and a password.
The other option is to use a runas, which is only available for Windows Script host at this time and only necessary in some rare cross-domain login situations.

So, specifying a userid and password is sufficient to create an exe that impersonates the specified user.

If that doesn't work you will get a specific error message. Do you get an error message when running an exe
with impersonation?

Please also refer to the corresponding section in the included manual.

Alexander Riedel2009-06-24 21:12:03
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
dcdelgado
Posts: 40
Last visit: Tue Feb 17, 2015 9:29 am

EXE Packager Alt Credentials Not Working?

Post by dcdelgado »

When i run the .exe something pops up in a ps cmd window then disappears very quickly before i can get a chance to look at the error message?And to which manual are you referring to?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

EXE Packager Alt Credentials Not Working?

Post by Alexander Riedel »

The manual that is included with PrimalScript, Help -> PrimalScript Manual...

If you are building a commandline package you should launch it from a command line (like cmd.exe or powershell.exe), that way it doesn't just flash by, but you can see the output.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
dcdelgado
Posts: 40
Last visit: Tue Feb 17, 2015 9:29 am

EXE Packager Alt Credentials Not Working?

Post by dcdelgado »

It seems that the package is not picking up the alt creds i put in, as when i run it now i get this for one of the services,"WARNING: Waiting for service 'Smart Card (SCardSvr)' to finish stopping...ERROR: Stop-Service : Service 'SmartTrust Smart Card Server (SmartTrust Smart Card SerERROR: ver)' cannot be stopped due to the following error: Cannot open SmartTrust SmarERROR: t Card Server service on computer '.'.ERROR: At line:18 char:13"But when i run it from a cmd window open with my admin account or if i right click the .exe and use runas with my admin account it runs and restarts the services fine?C:>powershell.exe -noexit c:FundSettleRestart.exeThis script package was created with atrial version of the SAPIEN Script Packager.Now Stopping the FundSettle ServicesNow Restarting the Fundsettle ServicesServices Have Now Been Restarted
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

EXE Packager Alt Credentials Not Working?

Post by Alexander Riedel »

If the impersonation would fail, you would get an error message that looks something like this:
LogonUser call failed with error code : <code>

I am sorry I cannot diagnose your domain structure or your security policies. The following might be helpful for your task:

- For best results I would suggest to see if specifying a local user with
sufficient rights works rather than a domain user.
- Impersonation also does NOT change your network login, it only changes the
security token on your local machine.
- If you are using WMI to start/stop services on a local or a remote machine
you should specify the required credentials on the PowerShell WMI call
rather than the entire script or exe.
- Last but not least, make sure your "normal" user actually has sufficient
rights to impersonate another user.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
dcdelgado
Posts: 40
Last visit: Tue Feb 17, 2015 9:29 am

EXE Packager Alt Credentials Not Working?

Post by dcdelgado »

- For best results I would suggest to see if specifying a local user with
sufficient rights works rather than a domain user.
** This is not allowed in our domain **- Impersonation also does NOT change your network login, it only changes the
security token on your local machine.
** All i want is for a normal user with no admin rights, to be able to run this packaged .exe and the exe to run under my admin account to restart the services, its looks like Primalscript does will not do this? **- If you are using WMI to start/stop services on a local or a remote machine
you should specify the required credentials on the PowerShell WMI call
rather than the entire script or exe.
** Not using WMI just PS cmd's, do you think WMI would work better, would my password be safe from view within the .exe? **- Last but not least, make sure your "normal" user actually has sufficient
rights to impersonate another user. ** The Normal user does have the rights needed to run the imporsonate **Regards.
This topic is 14 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.