Make exe

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

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 7 years and 4 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.
Locked
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Make exe

Post by stevens »

Product, version and build: 5.0.10586.117
32 or 64 bit version of product: 64
Operating system: W2K12R2
32 or 64 bit OS: 64
PowerShell Version: latest update

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Hi,

I have a script that checks health of a computer (cpu,memory,drive usages etc) and creates a nice html of it.
I'd like to be able to make it into an executable so when a user clicks on it, it pops up the html page.
Note that it takes some time to load so I'd also like it to show a window in which is mentioned what steps it's executing.
When report is finished, it should tell that the report is save on c:\reports\, please advise howto approach this or is there an example I could base my project on?
I could also use the powershell2exe but I guess I wouldn't have as much functionality as I would with PS Studio.

Please advise.
S.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Make exe

Post by Alexander Riedel »

[Topic moved by moderator]

This seems more like a general powershell question.
Please note that "PowerShell Version: latest update" doesn't mean much. Please be specific.
If you have specific packager questions, please post these in the product forum.
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Make exe

Post by jvierra »

PS Studio does not add functionality to a script. It is just an editor and debugger as well as a script management and deployment tool.

The blogs on this site can show you many methods for doing what you ask. They have many examples.

See: https://www.sapien.com/blog/topics/user ... istrators/
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Make exe

Post by stevens »

Thanks. Figured it out meanwhile.
One more thing: I'd need to make the exe run with a specific account (local admin) and password.
How can I achieve this?
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Make exe

Post by stevens »

Ok, just found it, that would be "run mode". However I'd like to give a popup when it would not work showing "password not correct, default password is changed".
Then it would be nice if I could send a mail so I could be alerted that somebody changed the local admin password.
Another item: there are some local admin passwords, could there be a way to check one by one?
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Make exe

Post by stevens »

Question about running the exe as local admin: I have in my report: "Report ran by $env:username", I want that to be the user who executed the exe but the exe is running with Administrator privileges so is showing "Report ran by Administrator".
How can I solve this?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Make exe

Post by jvierra »

If you run under alternate credentials then you are running as that user. You cannot give a standard user admin privileges. You can run a program as another user.
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Make exe

Post by stevens »

Ok thanks.
I can run my exe when adding the credentails als a local administrator but that limits the exe to those machines which have got the that administrator and password. When I launch it with a non admin account, it does not work. When I run the exe with right mouse the "run as administrator" it works.
I'd like the exe to run on any machine without the need to "run as administrator".
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Make exe

Post by jvierra »

stevens wrote: I'd like the exe to run on any machine without the need to "run as administrator".
This is not possible as asked. YOU can use a domain admin account but the local admin would have to be identical on all systems to do other wise.

userid: localhost\Administrator
passwd: <same password on all systems>
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Make exe

Post by stevens »

Ok, fair enough. Tried it with a domain account which has local access on multiple pc's but that does not work, it just executes and then stops no error ....
This topic is 7 years and 4 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.
Locked