Embedded Credentials Question

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 3 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
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Embedded Credentials Question

Post by B Daring »

Product: PowerShell Studio 2022 (64 Bit)
Build: v5.8.212
OS: Windows 10 Pro (64 Bit)
Build: v10.0.19044.0

Can I get some clarification on using embedded credentials in a packaged script? I have added my user name and password to the credentials in settings, packaged it up and ran it outside studio, the username was empty. Code below

I then found this
https://www.sapien.com/blog/2022/01/24/ ... your-code/
with a comment below:
"Language sometime is ambiguous. It will work for packaged executables, provided you have added the credentials to the resources,"

What does Alex mean by "provided you have added the credentials to the resources," What resource? Do I have to use primal script to get this working?

I am using the Script engine as Windows forms, added username and password to the credentials and then saved packaged and then built package. But when it runs the user is empty. I am doing the exact same thing as this guy, except using Windows Forms
viewtopic.php?p=82869

Code: Select all

$login = $SAPIENHost.GetUserID(0)
$pwd = $SAPIENHost.GetPassword(0)
$winscript.popup("login: $login", 2, "Setup", 4160)
$winscript.popup("Psw: $pwd", 2, "Setup", 4160)
User avatar
Olga_B
Site Admin
Posts: 196
Last visit: Mon Mar 18, 2024 9:24 am

Re: Embedded Credentials Question

Post by Olga_B »

I checked the Embedded Credentials in my testing environment, everything is working as expected
Attached a .zip file with simple form and .psbuild file
Try to build and run it on your machine
When form is loaded, click on Load button
Attachments
Post_16112.zip
(10.58 KiB) Downloaded 47 times
User avatar
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Re: Embedded Credentials Question

Post by B Daring »

Thanks for that. It appears that it doesn't work if you have "Obfuscate PowerShell Files" checked which I did as I was testing. Uncheck the box and it gives me the credentials as expected.

Thank you
This topic is 1 year and 3 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.