Is it possible to elevate the permissions of a powershell script so a user without admin privileges can run the script? Our network admins are trying to find more time-efficient ways to accomplish certain tasks that right now they have to use remote desktop for...automating them with PS scripts would help, but the users don't have admin rights.


Depending on what you are trying to do will determine greatly what the real answer is. If you want the powershell script to run on the remote machine and you want the user to be able to run it. Your only option is to have credentials embedded into the script. This is dangerous and should not be done.

If you can launch the scripts remotely, your options become much better. In Powershell V2 you have remoting as an option to complete many tasks which will use the rights of the user running the script (i.e. the admin) on the target machine (the user's PC). In V1 you have the option of launching the script remotely via PSExec to use the credentials of the Admin. You also have the option of running the script on the Admin's PC and building it to interact with the remote machine via WMI/PSExec/etc.

The short answer to your direct question is No you cannot do that. However, you can accomplish the same thing by approaching it from a slightly different angle.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy