In many cases, you need to run the program with the specified account;
For example, to run a program as an administrator under a non-Administrator account, you can use the following PS script:
<#
Script Editor: snail Yu
Date: 2014-09-17
#>
$ Uname = ". \ Administrator" # specify the user name. ". \ Administrator" indicates the local administrator.
$ Pwd = convertid-securestring "password"-asplaintext-force # "password" indicates the password of the local administrator.
$ Cred = new-Object System. Management. Automation. pscredential ($ uname, $ PWD) # Save the user and password in this variable
Start-process-filepath "C: \ Program Files (x86) \ Tencent \ QQ \ bin \ qq.exe"-credential $ cred # Run QQ with the specified account
Reference URL:
Http://biancheng.dnbcw.info/mssql/374833.html
Http://www.pstips.net/powershell-launching-applications-with-alternate-credentials.html
[Powershell] run the program with the specified account