2014-11-24 25 views
1

今天我需要W2008R2和Win7启用PSRemoting:错误就win2008R2和Win7启用PSRemoting

所有的虚拟机都在工作组中。
我已经在每台虚拟机上设置了相同的管理员帐户和相同的密码。
在管理员角色的PowerShell中运行启用-PSRemoting。
但是我仍然面临如下错误:

错误1:

Set-WSManQuickConfig : Access is denied.

错误2:

[192.168.23.2] Connecting to remote server failed with the following error message : The WinRM client cannot process th e request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain , then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken

错误3:

Set-WSManQuickConfig : WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Change the network connection type to either Domain or Private and try again.

回答

-1

后谷歌,误差是固定的以下解决方案:

错误1:
Set-WSManQuickConfig:访问被拒绝。

解决方案:
以管理员角色运行以下cmd。

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f 

错误2:

If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain , then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting.

解决方案:
以下运行在客户机上CMD

Set-Item WSMan:\localhost\Client\TrustedHosts * 

错误3:

Set-WSManQuickConfig : WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Change the network connection type to either Domain or Private and try again.

解决方案:
裁判:http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
运行在与adminsitrator作用PS脚本:

#Skip network location setting for pre-Vista operating systems 
if([environment]::OSVersion.version.Major -lt 6) { return } 

#Skip network location setting if local machine is joined to a domain. 
if(1,3,4,5 -contains (Get-WmiObject win32_computersystem).DomainRole) { return } 

#Get network connections 
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) 
$connections = $networkListManager.GetNetworkConnections() 

#Set network location to Private for all networks 
$connections | % {$_.GetNetwork().SetCategory(1)} 
5

对于错误3,运行此命令:

Set-WSManQuickConfig -SkipNetworkProfileCheck 

当您连接你的网络,它被设置为公共,私人或域名。如果当前配置文件设置为公共,Set-WSManQuickConfig将失败并显示该消息。您可以更改它(如果系统允许)或跳过配置文件检查。

+1

参数-SkipNetworkProfileCheck在PowerShell版本3.0或更高版本中可用。 – 2016-06-14 09:11:20