を使用してローカルホストに接続しようとしていNew-PSSession
ます。
私が持っています
を使用して構成されたWinRM
winrm quickconfig
PSリモーティングを有効にする
Enable-PSRemoting
信頼できるホストを追加
Set-Item WSMan:\localhost\Client\TrustedHosts * -Force
ファイアウォールの8173ポートにはインバウンドルールがあります。
の出力winrm
:
PS C:\> winrm get winrm/config/listener?Address=*+Transport=HTTP
Listener
Address = *
Transport = HTTP
Port = 8173
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
Listening on = 127.0.0.1
次のコマンドを実行しようとしています。
New-PSSession -ConnectionUri http://localhost:8173/WSMAN
しかし、私はこのエラーを受け取ります:
[localhost] Processing data from remote server failed with the following error message:
Error with error code 14 occurred while calling method WSManPluginReceiveResult. For
more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionOpenFailed
編集:
私が見る唯一の余分なことは、ネットワークがpublic $ listenerport = "8173" winrmwinrm create winrm / config / Listener?Address = * + Transport = HTTP " @
{Port =
" $ listenerport "
} "に接続されていることです。
C:\>winrm get winrm/config
Config
MaxEnvelopeSizekb = 1039440
MaxTimeoutms = 60000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = true
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 8173
HTTPS = 5986
TrustedHosts = *
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;S-1-5-21-2458768215-3945602940-3262220185-1045)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 500
EnumerationTimeoutms = 60000
MaxConnections = 25
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = true
Auth
Basic = true
Kerberos = false
Negotiate = true
Certificate = true
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 180000
MaxConcurrentUsers = 5
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 15
MaxMemoryPerShellMB = 150
MaxShellsPerUser = 5
PS C:\> Get-PSSessionConfiguration microsoft.powershell | fl *
xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration
Name : Microsoft.PowerShell
Filename : %windir%\system32\pwrshplugin.dll
SDKVersion : 1
XmlRenderingType : text
lang : en-US
PSVersion : 2.0
ResourceUri : http://schemas.microsoft.com/powershell/Microsoft.PowerShell
SupportsOptions : true
ExactMatch : true
Capability : {Shell}
Permission :
Administrators group have permission as I see in the window popup (Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI)
編集2:
ループバックアドレス(127.0.0.1)にのみ接続しているため、消去法により、ファイアウォールを問題として除外できます。正常に見えるWinRM構成を除外することもできます。
エラーメッセージは、へのTCP接続http://localhost:8173/WSMAN
は実際には成功しているが、PSセッションの確立中に障害が発生したことを示しています。
これは、Microsoft.PowerShellセッション構成を示しています。
見たときに表示される権限に不一致があるようです
Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI
そして実際にMicrosoft.PowerShellに割り当てられたアクセス許可。の出力
Get-PSSessionConfiguration microsoft.powershell | fl *
「SecurityDescriptorSddl」および「Permission」プロパティがリストされている必要があります。このような:
Name : microsoft.powershell
Filename : %windir%\system32\pwrshplugin.dll
SDKVersion : 1
XmlRenderingType : text
lang : en-US
PSVersion : 2.0
ResourceUri : http://schemas.microsoft.com/powershell/microsoft.powershell
SupportsOptions : true
Capability : {Shell}
xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration
Uri : http://schemas.microsoft.com/powershell/microsoft.powershell
ExactMatch : true
SecurityDescriptorSddl : O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
Permission : BUILTIN\Administrators AccessAllowed
これらの権限を削除して再割り当てしてみてください。
編集:
あなたが提供した情報に基づくと、これは主な問題ではありません。また、WinRMサービス設定に非標準の「RootSDDL」があることにも気づきました。
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;S-1-5-21-2458768215-3945602940-3262220185-1045)(AU;SA;GWGX;;;WD)
デフォルトでは、これは
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)
これをテストVMで再作成しましたが、リモーティングは引き続き機能します。そこで、WinRMの構成をもう一度確認しました...
解決
あなたの問題はこの行です
MaxEnvelopeSizekb = 1039440
この値を設定することで、私はあなたが抱えている問題を再現することができます。これをより合理的なものに設定するか、デフォルトに設定することをお勧めします。
winrm set winrm/config '@{MaxEnvelopeSizekb="150"}'
あなたの問題を解決します。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加