I have at least two problems I need help with.
Short vs. long names: I can do an nslookup on Serveradmin and Serveradmin.company.com and get good an IP addresses for both.
Problem 1: If I do this, I get this:
Invoke-Command -ComputerName Serveradmin -ScriptBlock {Get-PSDrive | Where {$_.Free -gt 0}}
[Serveradmin] Connecting to remote server Serveradmin failed with the following error message : WS-Management cannot process the request. The operation failed because of an HTTP error. The HTTP error (12152) is: The server returned an invalid or unrecognized response . For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (Serveradmin:String) [], PSRemotingTransportException + FullyQualifiedErrorId : WinRMOperationAborted,PSSessionStateBroken This command line does not work with the short or long name.
Problem 2: Now if I do this I get this (with a SessionOption):
Invoke-Command -ComputerName Serveradmin -SessionOption ( New-PSSessionOption -ProxyAccessType NoProxyServer ) -ScriptBlock {Get-PSDrive | Where {$_.Free -gt 0}}
I get good data.
If I try to use the long name (Serveradmin.company.com), I get this error message:
[Serveradmin.lmms.lmco.com] Connecting to remote server lc1admin.lmms.lmco.com failed with the following error message : WinRM cannot process the request. The following error occurred while using Kerberos authentication: Cannot find the computer Serveradmin.lmms.lmco.com. Verify that the computer exists on the network and that the name provided is spelled correctly. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (Serveradmin.lmms.lmco.com:String) [], PSRemotingTransportException + FullyQualifiedErrorId : NetworkPathNotFound,PSSessionStateBroken Q3: Does "Proxy" equate to the proxy server we use for internet web access?
Can anyone help me with these issues? I'd really like to use both short and long names.
UPDATE: https://www.pdq.com/powershell/new-pssessionoption/#ProxyAccessType I found this reference:
Determines which mechanism is used to resolve the host name. Any ideas how I can force "NoProxyServer" on all scripts without modifying my scripts?