所以我試圖讓腳本從另一臺服務器上的服務器遠程運行腳本。由於cmdlet,此會話必須是32位。腳本必須以管理員身份運行。 我已經試過這樣:使用提升的權限執行遠程32位PSSession
Invoke-Command -ComputerName isg108-81 -FilePath C:\inetpub\scrip\ConvertAppvPackages.ps1 -ConfigurationName microsoft.powershell32 -credentials Admin
所以這個開始的PowerShell的32位版本,但只要劇本到達那裏需要提升權限的殼告訴我的一部分:
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.
有人有什麼想法嗎?
Thnx很多爲您的幫助!
這很奇怪,因爲遠程處理會話通常已經提升,這就是爲什麼您需要管理員憑據來啓動遠程處理會話。 –
在腳本運行時,有沒有辦法切換到提升模式? @KeithHill – Matt
切換到提升模式的唯一方法是使用'開始 - 進程powershell.exe -arg'c:\ blah \ script.ps1'-verb runas'。假設用戶具有管理員權限,但在UAC中使用標準用戶令牌運行。您也可以使用-Credentials參數而不是'-Verb runas'作爲具有管理權限的不同用戶運行。 –