2013-04-17 14 views
7

Non riesco a remotizzare in nessuna macchina per salvarmi la vita! Ho provato tutto quello che riesco a trovare. Se qualcuno potesse risolvere il problema o guidarmi, lo apprezzerei in quanto sarebbe un ottimo strumento da aggiungere al mio dominio.Impossibile creare la sessione di PowerShell remota dopo Enable-PSRemoting

SETUP: macchina

  1. client all'interno del dominio
  2. Server macchina all'interno o al di fuori del dominio - virtualizzato e utilizzato per WSUS Nomecomputer: wsustest
  3. CLIENT SERVER MACCHINA fisico-computername: epizzi-pc

PASSAGGI:

 
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

Sei in grado di telnet sulla porta '5985' sul client? – MDMoore313

risposta

0

Sbarazzarsi della -UseSSL. Ho abilitato PSRemoting e ho avuto problemi con l'utilizzo di questo. Immagino di poterlo vedere più tardi ma per ora non importa.

+0

ho provato wihtout useSSL, ho ancora un errore – user1056661

1

Se non c'è fiducia tra il client ei computer server, è necessario abilitare l'autenticazione di base sul lato server. A tale scopo, commutare le proprietà corrette su WSMAN: guidare sul server. Avrete ovviamente bisogno di fare questo in modo interattivo sulla console o tramite desktop remoto, a causa del problema dell'uovo e della gallina :) Inoltre, questo può entrare in gioco anche:

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

+0

e l'ho aggiunto al dominio, tranne che non possiedo un account admin. quindi ero con credenziali di account admin locali, proverò i tuoi suggerimenti – user1056661

0

ho raggiunto una sessione remota con il comando Enter-PSSession, dovuto seguire questi parametri esatti

$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 

avevo anche per impostare client e server remoto nel host WSMan di fiducia: lo spazio

un'altra soluzione che sicuramente wouldve ha funzionato ma ho ettaro sfogo provato, sarebbe stato impostato https: che è più difficile da fare.

grazie a tutti, i vostri commenti hanno sicuramente portato alla soluzione!

2

Ecco come lo faccio. Lo uso sui miei script.

# 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

che stavo ricevendo lo stesso problema quando il servizio remoto a un server e trovato questo post del blog molto utile - http://jeffgraves.me/2013/10/14/powershell-remoting/

Per il mio caso specifico ho fatto la seguente:

sulla macchina locale

  1. winrm quickconfig (anche se questo era già configurato)
  2. winrm s winrm/config/cli ent '@ {TrustedHosts = "nomeutente.dominio "}'

sulla macchina remota

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

"nomeserver.dominio" '' si riferisce alla macchina remota in questo caso? –

+0

Questo è corretto, come indicato nel post di Jeff Graves '... sarà necessario aggiungere il sistema remoto all'elenco TrustedHosts sul sistema client' – IsolatedStorage

0

ho ottenuto intorno a questo problema utilizzando un accesso completo. Invece di "netbiosdomain \ accountname", ho utilizzato fqdn \ accountname, come in Microsoft.com \ myaccount nel prompt get-credential. Potrebbe non funzionare per tutti, ma vale la pena provare.

Problemi correlati