1

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?

1
  • By default, if I run this command I get this: New-PSSessionOption | select -Property ProxyAccessType ProxyAccessType --------------- None Commented Sep 2, 2020 at 20:50

1 Answer 1

0

Disable your Anti-virus on the remote server and re-run "Invoke-Command -ComputerName Serveradmin -ScriptBlock {Get-PSDrive | Where {$_.Free -gt 0}}"

Anti-virus's can block HTTP requests, and you will need to figure what configuration needs to be changed on your AV.

See further info here: https://mikefrobbins.com/2012/06/21/welcome-to-powershell-hell/

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.