I would like to know if it is possible spawn a command prompt as a local administrator with a script in a secure way.
Ideally, the script could be copied to any users desktop, and double-clicking it would spawn a command prompt running as the local administrator account.
Running the following command will spawn a command prompt running as an administrator, but the credentials are in plain text, and it requires you to type in the username and computer name for each computer
psexec \\ComputerNameGoesHere -u ComputerNameGoesHere\administrator -p PasswordGoesHere cmd.exe
I would be alright with it being a powershell script, but the execution policy is set to restricted by default, so that would need to be compensated for.
Ideally, a single batch or powershell script that would do the following.
- User double clicks script
- Window pops up...