gpt4 book ai didi

powershell - 以提升的权限执行远程32位PSSession

转载 作者:行者123 更新时间:2023-12-03 00:19:07 25 4
gpt4 key购买 nike

因此,我试图获取一个脚本,以便从另一台服务器上的服务器远程运行脚本。由于有cmdlet,此 session 必须为32位。并且脚本必须以admin身份运行。
我已经试过了:

Invoke-Command -ComputerName isg108-81 -FilePath C:\inetpub\scrip\ConvertAppvPackages.ps1 -ConfigurationName microsoft.powershell32 -credentials Admin

因此,这将启动Powershell的32位版本,但是一旦脚本到达需要提升权限的部分,Shell就会告诉我:
You must run this cmdlet using a Windows PowerShell elevated command prompt . To run
an elevated command prompt, right-click the Windows PowerShell or Command Prompt Start
menu object that you are using to start your Windows PowerShell sessions, and then
Select Run as administrator.

有人有想法吗?

多谢您的协助!

最佳答案

如果服务器是64位操作系统,则必须调用32位powershell.exe。如果调用服务器运行32 exe并运行脚本怎么办?自从您调用它以来,该程序将不会显示,并且脚本必须输出一些文件才能查看任何结果。

关于powershell - 以提升的权限执行远程32位PSSession,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22176324/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com