Cannot create remote powershell session after Enable-PSRemoting

前端 未结 7 814
别跟我提以往
别跟我提以往 2021-01-30 23:45

I can not remote into any machine to save my life! I have tried everything I can find. If anyone could troubleshoot or guide me, I\'d appreciate it as this would be a great tool

相关标签:
7条回答
  • 2021-01-30 23:49

    This is how I do it. I use this on my scripts.

    # This is only done once
    Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File
    c:\Windows\temp\securepass.txt
    
    # Setup credentials
    $SecureString = Get-Content c:\Windows\temp\securepass.txt | ConvertTo-SecureString
    $mycredentials = New-Object -TypeName System.Management.Automation.PSCredential
        -ArgumentList "yourDomain\userID",$SecureString
    
    # Open remote session:
    $MyRSession = New-PSSession -ComputerName Computer1 -Credential $mycredentials
        -Authentication default
    
    # Use remote session:
    Enter-PSSession $MyRSession
    
    0 讨论(0)
  • 2021-01-30 23:53

    I was getting that same error currently no logon servers available. The issue was resolved by using instead of Domain\Username as credentials the user UPN or Username@Domain.

    0 讨论(0)
  • 2021-01-30 23:58

    I have achieved a remote session with Enter-pssession command, had to follow these exact parameters

    $creds =  get-credential (the -credential parameter in enter-pssession does not work properly, thus u must         previously enter the object at another variable)
    Enter-pssession -computername wsustest -authentication Default -credentials $creds
    

    i Also had to set both client and remote server in the trusted hosts wsman: space

    another solution which surely wouldve worked but i havent tried, wouldve been setting https: which is harder to do.

    thx to all, your comments certainly led to the solution!

    0 讨论(0)
  • 2021-01-31 00:02

    I got around this problem by using a fully qualified logon. Instead of "netbiosdomain\accountname", I used fqdn\accountname, as in Microsoft.com\myaccount in the get-credential prompt. May not work for everyone, but it's worth a shot.

    0 讨论(0)
  • 2021-01-31 00:03

    I was receiving the same problem when remoting to a server and found this blog post very helpful - http://jeffgraves.me/2013/10/14/powershell-remoting/

    For my specific case I did the following:

    On the Local machine

    1. winrm quickconfig (although this was already configured)
    2. winrm s winrm/config/client '@{TrustedHosts="myservername.domain"}'

    On the Remote machine

    1. enable-psremoting -force
    2. Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell -Force
    0 讨论(0)
  • 2021-01-31 00:06

    Get rid of -UseSSL. I enabled PSRemoting and had problems with using that. I guess I could look at it later but for now it doesn't matter.

    0 讨论(0)
提交回复
热议问题