I created the procedure below to get the list of the installed programs on a remote machine. I tested it on my computer and it worked fine, but when I try to use in my network I am getting the error below.
I am running it as network admin.
Code:
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:
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