2013-04-17 23 views
7

Tôi không thể điều khiển từ xa vào bất kỳ máy nào để tiết kiệm cuộc sống của mình! Tôi đã thử mọi thứ tôi có thể tìm thấy. Nếu bất cứ ai có thể khắc phục sự cố hoặc hướng dẫn tôi, tôi sẽ đánh giá cao vì đây sẽ là công cụ tuyệt vời để thêm vào miền của tôi.Không thể tạo phiên powerhell từ xa sau khi bật-PSRemoting

SETUP: Máy

  1. Khách hàng bên trong miền
  2. server máy bên trong hoặc bên ngoài miền - Ảo hóa và sử dụng cho WSUS Computername: wsustest
  3. KHÁCH HÀNG MÁY CHỦ MÁY physical- computername: epizzi-pc

BƯỚC:

 
enable-pssremoting done! on all machines 
trustedhosts configured with * or client machine added 
Firewalls with public profile off just in case 

 
Enter-PSSession -ComputerName wsustest -Credential wsustest\administrator 
Enter-PSSession -ComputerName epizzi-pc -Credential epizzi-pc\administrador 
Enter-PSSession : Connecting to remote server epizzi-pc failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 
occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request. 
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. 
At line:1 char:1 
+ Enter-PSSession -ComputerName epizzi-pc -Credential epizzi-pc\administrador 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidArgument: (epizzi-pc:String) [Enter-PSSession], PSRemotingTransportException 
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed 

 
Enter-PSSession -ComputerName wsustest -UseSSL -Credential wsustest\administrator 

*Enter-PSSession : Connecting to remote server wsustest failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is 
valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM 
firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic. 
At line:1 char:1 
+ Enter-PSSession -ComputerName wsustest -UseSSL -Credential wsustest\administrato ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidArgument: (wsustest:String) [Enter-PSSession], PSRemotingTransportException 
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed* 
ERRORs: 
+0

Bạn có thể telnet đến cổng '5985' trên máy khách không? – MDMoore313

Trả lời

0

Loại bỏ -UseSSL. Tôi đã bật PSRemoting và gặp sự cố khi sử dụng tính năng này. Tôi đoán tôi có thể xem nó sau nhưng bây giờ nó không quan trọng.

+0

tôi đã thử sử dụng wLtout useSSL, vẫn gặp lỗi – user1056661

1

Nếu không có sự tin tưởng giữa máy khách và máy chủ, bạn phải bật xác thực cơ bản ở phía máy chủ. Làm điều này bằng cách chuyển đổi các thuộc tính chính xác trên WSMAN: ổ đĩa trên máy chủ. Bạn rõ ràng là sẽ phải làm điều này một cách tương tác trên giao diện điều khiển hoặc thông qua máy tính để bàn từ xa, do con gà và quả trứng vấn đề :) Ngoài ra, điều này có thể đi vào chơi quá:

http://www.nivot.org/blog/post/2009/10/30/PowerShell20EnablingRemotingWithVirtualXPModeOnWindows7

+0

tôi cũng đã thêm nó vào miền, ngoại trừ tôi không sở hữu tài khoản quản trị. vì vậy tôi đã tring với tài khoản quản trị địa phương creds, tôi sẽ cố gắng ur đề xuất – user1056661

0

tôi đã đạt được một phiên từ xa với lệnh Nhập-pssession, phải làm theo các thông số chính xác

$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 

tôi cũng đã phải đặt cả client và server từ xa trong các host wsman tin cậy: không gian

một giải pháp mà chắc chắn wouldve làm việc nhưng tôi ha vent đã cố gắng, đã được thiết lập https: đó là khó khăn hơn để làm.

thx cho tất cả, nhận xét của bạn chắc chắn đã dẫn đến giải pháp!

2

Đây là cách tôi thực hiện. Tôi sử dụng điều này trên kịch bản của tôi.

# 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 
2

tôi đã nhận được cùng một vấn đề khi truy cập từ xa đến một máy chủ và tìm thấy bài blog này rất hữu ích - http://jeffgraves.me/2013/10/14/powershell-remoting/

Đối với trường hợp cụ thể của tôi, tôi đã làm như sau:

Trên máy Local

  1. quickr winrm quickconfig (mặc dù cấu hình này đã được định cấu hình)
  2. winrm s winrm/config/cli ent '@ {TrustedHosts = "myservername.miền "}'

Trên máy từ xa

  1. enable-psremoting -force
  2. Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell -force
+0

là '" myservername.domain "' đề cập đến máy từ xa trong trường hợp này? –

+0

Thats đúng, như đã đề cập trong bài đăng của Jeff Graves '... bạn sẽ cần phải thêm hệ thống từ xa vào danh sách TrustedHosts trên hệ thống khách hàng' – IsolatedStorage

0

tôi xung quanh này Thay vì "netbiosdomain \ accountname", tôi đã sử dụng fqdn \ accountname, như trong Microsoft.com \ myaccount trong lời nhắc nhận thông tin xác thực. Có thể không hoạt động với mọi người, nhưng nó đáng để quay.