Shared file(.exe) run with domain user with password

S. M. Gulam Kibria Chowdhury 6 Reputation points
2022-09-27T07:47:06.247+00:00

Hello ,

Like to execute .exe file (which is shared over network) by privilege domain user including password.
Domain user will get a link which will pushed by gpo . When domain user click the link, an exe file("file.exe") will start to execute without prompting for credentials.

Is it possible?

Thank you.

Microsoft 365 and Office | Development | Office JavaScript API
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,766 Reputation points
    2022-09-29T08:38:31.197+00:00

    Hello,

    The best way would be to store the encrypted credentials in the file, to be used to run the code.

    To create the encrypted string password you can use this:

    Create encrypted string

    New-StringEncryption -StringToEncrypt 'MySecurePassword123'

    Output string

    kvKHaoJytKOhWVSLRwpaAb4jBDz0i/s4yUdlhFKpNi0=

    Once you have that secure string, you can add it into your script:

    Define Credentials

    [string]$userName = 'admin'
    [SecureString]$securePwd = ConvertTo-SecureString -String (New-StringDecryption -EncryptedString 'kvKHaoJytKOhWVSLRwpaAb4jBDz0i/s4yUdlhFKpNi0=') -AsPlainText -Force

    Create the credential object

    [pscredential]$credentialObject = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName, $securePwd

    Continue your Code here

    -------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.