【发布时间】:2012-11-11 09:20:08
【问题描述】:
在 powershell 中,我可以使用 Catch [System.UnauthorizedAccessException] 捕获 Access is Denied 错误。我如何同样捕获 RPC Server Unavailable 错误?
【问题讨论】:
-
我认为这是更多细节的错误:
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At C:\Users\flickerfly\Documents\scripts\Set-LocalServerAdmin.ps1:22 char:33 + $oldexists = Get-WmiObject <<<< Win32_UserAccount -Filter "Name='$olduser'" -ComputerName $computerName + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
标签: powershell powershell-remoting