在本地主机上执行命令我得到访问被拒绝错误如下
PS C:\Windows\System32> winrs -r:localhost dir Winrs error:Access is denied. PS C:\Windows\System32>
Followig是我的configuration
PS C:\Windows\System32> winrm enumerate winrm/config/listener Listener Address = * Transport = HTTP Port = 80 Hostname Enabled = true URLPrefix = wsman CertificateThumbprint ListeningOn = 127.0.0.1, 192.168.1.3, ::1, 2001:0:4137:9e50:20d3:3b94:3f57:fefc, fe80::5efe:192.168.1.3%11, fe80::20 d3:3b94:3f57:fefc%12, fe80::adea:d512:c3d3:8b08%10 PS C:\Windows\System32> winrm get winrm/config Config MaxEnvelopeSizekb = 150 MaxTimeoutms = 60000 MaxBatchItems = 20 MaxProviderRequests = 25 Client NetworkDelayms = 5000 URLPrefix = wsman AllowUnencrypted = false Auth Basic = true Digest = true Kerberos = true Negotiate = true Certificate = true DefaultPorts HTTP = 80 HTTPS = 443 TrustedHosts = * Service RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;ER)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD) MaxConcurrentOperations = 100 EnumerationTimeoutms = 60000 MaxConnections = 25 AllowUnencrypted = false Auth Basic = true Kerberos = true Negotiate = true Certificate = false DefaultPorts HTTP = 80 HTTPS = 443 IPv4Filter = * IPv6Filter = * Winrs AllowRemoteShellAccess = true IdleTimeout = 900000 MaxConcurrentUsers = 5 MaxShellRunTime = 2147483647 MaxProcessesPerShell = 5 MaxMemoryPerShellMB = 80 MaxShellsPerUser = 2
我该怎么做才能使它工作?
我有Windows Vist Starter Edition我正在使用PowerShell CTP 3
由于您正在运行Vista Starter Edition,因此您的系统不能成为域的一部分。 这对WinRM(和PowerShell Remoting)有影响 – 以下是Powershell的内部帮助:
ps> get-help about_remote_faq | more
最后这个有以下的说法:
我可以在单台计算机上进行testing(不在一个域中)吗?
是。 即使在本地时,Windows PowerShell远程处理也是可用的
电脑不在一个域中。 您可以使用远程function
连接到会话并在同一台计算机上创build会话。 该
function与连接到远程计算机时的function相同。要在工作组中的计算机上运行远程命令,请更改
在计算机上进行Windows设置。– Windows Vista:
Create the following registry entry, and then set its value to 1: LocalAccountTokenFilterPolicy in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System You can use the following Windows PowerShell command to add this entry: new-itemproperty ` -path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System`-name LocalAccountTokenFilterPolicy -propertyType DWord -value 1
什么OS? 什么版本的WinRM? 我看到默认端口是80和443,这意味着你可能使用WinRM 1.1或WinRM 2.0 CTP1或CTP2。
如果您使用的是XP并启用了IIS,则WinRM出现问题。 我不确定这是否已经被修复。 解决方法是简单地停止IIS服务,然后看到WinRM开始工作。 一个更永久的解决方法是将WinRM服务器端口从80改为其他。
编辑:好的,在RC中,端口也许从80和443改变了。 CTP3仍然使用这些通用端口。