-6
我試圖運行PowerShell命令來獲取所有遠程服務器的所有驅動器的總磁盤空間。當我運行命令時,我得到下面的錯誤。我有一個具有服務器名稱的文本文件,我也確認WinRM已配置並正在運行。嘗試枚舉遠程計算機上的驅動器時出現「訪問被拒絕」錯誤
$Servers = Get-Content "C:\users\anorris\desktop\DR\servers1.txt"
foreach ($s in $Servers) {
Invoke-Command -ComputerName $s {Get-PSDrive}
}
錯誤:
[ahv-a2acortst02] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken
該錯誤信息是直線前進。你不這樣做,或該進程沒有,有權訪問驅動器。您是否查看過? –
該錯誤特別提到了['about_Remote_Troubleshooting'](https://technet.microsoft.com/zh-cn/library/hh84 7850.aspx)幫助主題。你看過那個嗎?你的發現是什麼? –