0
我创建了以下程序以获取远程计算机上已安装程序的列表。我在我的电脑上测试过它,它运行良好,但是当我尝试在我的网络中使用时,出现下面的错误。获取远程计算机上已安装程序的列表
我正在运行它作为网络管理员。
代码:
Invoke-Command -ComputerName brpgd008 {
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
Format-Table –AutoSize > \\brspd010\c$\users\machael1\desktop\product1.txt
}
错误:
error:[brpgd008] Connecting to remote server failed with the following error message : WinRM cannot process the request. The following error occured while using Kerberos authentication : A specified logon session does not exist. It may already have been terminated. Possible causes are: -The user name or password specified are invalid. -Kerberos is used when no authentication method and no user name are specified. -Kerberos accepts domain user names, but not local user names. -The Service Principal Name (SPN) for the remote computer name and port does not exist. -The client and remote computers are in different domains and there is no trust between the two domains. After checking for the above issues, try the following: -Check the Event Viewer for events related to authentication. -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport. Note that computers in the TrustedHosts list might not be authenticated. -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken
您是否真的烦读过错误信息? –
您需要首先建立与远程机器的连接。 Get-Help WinRM –
错误信息非常清晰。您应该像@WillWebb所建议的那样查看WinRM并查看Powershell Remoting。 –