use*_*585 3 powershell scripting
我试图运行一个powershell脚本作为没有"脚本运行"权限的特定用户登录.如果我想以不同的用户身份运行脚本,是否可以将凭据作为参数添加到脚本中?
./Get-Something-computerName SERVER1 -filePath C:\ Whatever -credentials ??
提前干杯!(Powershell noob)
Invoke-Command -FilePath "yourPath\yourScript.ps1" -ComputerName yourServer -Credential Get-Credential
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
41069 次 |
| 最近记录: |