Question

Some days ago, i was able do create a remote session using short name of the remote server/workstation.

This doesnt work anymore error is :

+ CategoryInfo : InvalidArgument : (computername1:String) [Enter-PSSession], PSRemotingTransportExcepti + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

but when i use the complete domain name it is working : nsn computername1.domain.com

Dns resolution is correct, what else can i check to troubleshoot this problem ?

Was it helpful?

Solution

I've finaly found it ! :)

I had to modify the default pssession option and set the proxy to 'NoProxyServer' instead of the default value 'none'

so I added this line in my profile :

$PSSessionOption = New-PSSessionOption -ProxyAccessType NoProxyServer  

From technet :

None The proxy access type is not specified. This means that proxy information, such as the access type, authentication mechanism, and credential, is not passed to the Web Services for Management (WSMan) protocol service. This field is introduced in Windows PowerShell 2.0.

NoProxyServer No proxy server is used when configuring proxy settings. This mechanism resolves all the host names locally. This field is introduced in Windows PowerShell 2.0.

OTHER TIPS

As i cant find the source of the problem here is my workaround : rename the two aliases nsn and etsn and replace them by these functions in my profile :

rename-item alias:\nsn nsn2 -ea silentlycontinue
rename-item alias:\etsn etsn2 -ea silentlycontinue

function resolve-hostname{
    param($computername)
    [System.Net.Dns]::GetHostEntry($computername) |select -ExpandProperty hostname 
}

function nsn{
    param($computername)
    $cn=resolve-hostname $computername
    new-pssession -cn $cn
}

function etsn{
    param($computername)
    $cn=resolve-hostname $computername
    enter-pssession -cn $cn
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top