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.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
855 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,322 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,001 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