This topic contains 4 replies, has 3 voices, and was last updated by
November 1, 2016 at 10:59 pm #56648
$server = $env:mfdrives $apps = "\\$server\Apps\" Start-Process $apps\faxUploadSetup.exe
When I run this, it opens the faxupload.exe software, which is good, but if I try to install it, it will ask for admin credentials. How would I store the admin usename and password in the script so that when a user runs it, it won't ask them?
November 2, 2016 at 6:43 am #56659ParticipantTopics: 0Replies: 18Points: 0Rank: Member
$Username = "administrator" $Password = "ThisIsThePassword" $Credentials = New-Object PSCredential($UserName,$(ConvertTo-SecureString -AsPlainText -String $Password -Force)) $server = $env:mfdrives $apps = "\\$server\Apps\" Start-Process $apps\faxUploadSetup.exe -Credential $Credentials
You can obfuscate the credentials using base64 encoding or something else. I still haven't found of a foolproof way of providing admin credentials to scripts like this. They're always stored somewhere.
November 2, 2016 at 9:51 am #56675ParticipantTopics: 14Replies: 34Points: 0Rank: Member
I haven't been able to try it myself yet, but I'd look into the credential manager rather than saving the password as plaintext.
This module might assist you:
November 2, 2016 at 11:39 am #56678
Thank you all,
I'll try that
November 2, 2016 at 11:53 am #56681
Now it says
Start-Process : This command cannot be run due to the error: Logon failure: unknown user name or bad password.
I verified that the username and passwords are correct.
The topic ‘running .exe as admin with username and password’ is closed to new replies.