PowerShell / PowerShell/PowerShell

Unable to open to PowerShell.7 session configuration without Admin

Offen
#18,741 10 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Needs-Triage WG-Remoting WG-Security
Vorherrschende Sprache
C#
Sterne
55.5k
Forks
8.5k
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
88

Beschreibung

Prerequisites
Steps to reproduce
  1. In a fresh Windows 10 Hyper-V VM create a user and add to the Administrators group
  2. While logged into the VM as this user:
    1. Install Powershell 7.3.0 (e.g. winget install --id Microsoft.Powershell --source winget)
    2. Start an elevated Powershell 7 session and run Enable-PSRemoting to create PSSession Configurations (i.e. "PowerShell.7")
  3. From the Hyper-V host (Windows 11 in this instance) confirm you're able to execute commands using the 'PowerShell.7' configuration: Invoke-Command -VMName $vmName -Credential $creds -ConfigurationName PowerShell.7 -ScriptBlock { $PSVersionTable }
    • Expected Behavior
  4. In the VM, remove the user from the Administrators group and add them to the Remote Management Users group.
  5. From the Hyper-V, confirm you're still able to execute commands using the 'PowerShell.7' configuration: Invoke-Command -VMName $vmName -Credential $creds -ConfigurationName PowerShell.7 -ScriptBlock { $PSVersionTable }
    • Actual Behavior
  6. In the VM, add the user and/or Users group to the PowerShell.7 Session Configuration by invoking: Set-PSSessionConfiguration -Name PowerShell.7 -ShowSecurityDescriptorUI
  7. From the Hyper-V, confirm you're still able to execute commands using the 'PowerShell.7' configuration: Invoke-Command -VMName $vmName -Credential $creds -ConfigurationName PowerShell.7 -ScriptBlock { $PSVersionTable }
    • Actual Behavior
Expected behavior
PS> Invoke-Command -VMName $vmName -Credential $creds -ConfigurationName PowerShell.7 -ScriptBlock { $PSVersionTable }

Name                           Value
----                           -----
WSManStackVersion              3.0
OS                             Microsoft Windows 10.0.19044
PSVersion                      7.3.0
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
GitCommitId                    7.3.0
Platform                       Win32NT
PSEdition                      Core
Actual behavior
PS> Invoke-Command -VMName $vmName -Credential $creds -ConfigurationName PowerShell.7 -ScriptBlock { $PSVersionTable }
OpenError: Cannot create or open the configuration session PowerShell.7.
Error details
PS> Get-Error
Exception             :
    Type                      : System.Management.Automation.RemoteException
    SerializedRemoteException : System.Management.Automation.PSInvalidOperationException: Cannot create or open the
configuration session PowerShell.7. ---> System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to
remote server localhost failed with the following error message : <f:WSManFault
xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2689860592"
Machine="localhost"><f:Message><f:ProviderFault provider="PowerShell.7"
path="C:\Windows\system32\PowerShell\7.3.0\pwrshplugin.dll"></f:ProviderFault></f:Message></f:WSManFault> For more information,
see the about_Remote_Troubleshooting Help topic.
                                at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
                                at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult
asyncResult)
                                at System.Management.Automation.RemoteRunspace.Open()
                                at System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String
configurationName, PSHost host)
                                --- End of inner exception stack trace ---
                                at System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String
configurationName, PSHost host)
                                at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreatedForTypeTable(Object sender, RunspaceCreatedEventArgs
args)
                                at System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreated(Object sender,
RunspaceCreatedEventArgs args)
                                at System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1 eventHandler,
Object sender, T eventArgs)
                                at System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1 eventHandler,
Object sender, T eventArgs)
                                at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CreateRunspace()
                                at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.OpenHelper()
    ErrorRecord               :
        Exception             :
            Type                      : System.Management.Automation.RemoteException
            SerializedRemoteException : System.Management.Automation.PSInvalidOperationException: Cannot create or open the
configuration session PowerShell.7. ---> System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to
remote server localhost failed with the following error message : <f:WSManFault
xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2689860592"
Machine="localhost"><f:Message><f:ProviderFault provider="PowerShell.7"
path="C:\Windows\system32\PowerShell\7.3.0\pwrshplugin.dll"></f:ProviderFault></f:Message></f:WSManFault> For more information,
see the about_Remote_Troubleshooting Help topic.
                                        at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
                                        at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult asyncResult)
                                        at System.Management.Automation.RemoteRunspace.Open()
                                        at System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String
configurationName, PSHost host)
                                        --- End of inner exception stack trace ---
                                        at System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String
configurationName, PSHost host)
                                        at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreatedForTypeTable(Object sender, RunspaceCreatedEventArgs
args)
                                        at System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreated(Object
sender, RunspaceCreatedEventArgs args)
                                        at System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1
eventHandler, Object sender, T eventArgs)
                                        at System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1
eventHandler, Object sender, T eventArgs)
                                        at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CreateRunspace()
                                        at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.OpenHelper()
            ErrorRecord               :
                Exception             :
                    Type                      : System.Management.Automation.RemoteException
                    SerializedRemoteException : System.Management.Automation.PSInvalidOperationException: Cannot create or open
the configuration session PowerShell.7. ---> System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to
remote server localhost failed with the following error message : <f:WSManFault
xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2689860592"
Machine="localhost"><f:Message><f:ProviderFault provider="PowerShell.7"
path="C:\Windows\system32\PowerShell\7.3.0\pwrshplugin.dll"></f:ProviderFault></f:Message></f:WSManFault> For more information,
see the about_Remote_Troubleshooting Help topic.
                                                at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
                                                at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult asyncResult)
                                                at System.Management.Automation.RemoteRunspace.Open()
                                                at System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String
configurationName, PSHost host)
                                                --- End of inner exception stack trace ---
                                                at System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String
configurationName, PSHost host)
                                                at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreatedForTypeTable(Object sender, RunspaceCreatedEventArgs
args)
                                                at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreated(Object sender, RunspaceCreatedEventArgs args)
                                                at System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1
eventHandler, Object sender, T eventArgs)
                                                at System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1
eventHandler, Object sender, T eventArgs)
                                                at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CreateRunspace()
                                                at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.OpenHelper()
                    ErrorRecord               :
                        Exception             :
                            Type                      : System.Management.Automation.RemoteException
                            SerializedRemoteException : System.Management.Automation.PSInvalidOperationException: Cannot create
or open the configuration session PowerShell.7. ---> System.Management.Automation.Remoting.PSRemotingTransportException:
Connecting to remote server localhost failed with the following error message : <f:WSManFault
xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2689860592"
Machine="localhost"><f:Message><f:ProviderFault provider="PowerShell.7"
path="C:\Windows\system32\PowerShell\7.3.0\pwrshplugin.dll"></f:ProviderFault></f:Message></f:WSManFault> For more information,
see the about_Remote_Troubleshooting Help topic.
                                                        at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
                                                        at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult asyncResult)
                                                        at System.Management.Automation.RemoteRunspace.Open()
                                                        at
System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String configurationName, PSHost host)
                                                        --- End of inner exception stack trace ---
                                                        at
System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String configurationName, PSHost host)
                                                        at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreatedForTypeTable(Object sender, RunspaceCreatedEventArgs
args)
                                                        at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreated(Object sender, RunspaceCreatedEventArgs args)
                                                        at
System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1 eventHandler, Object sender, T eventArgs)
                                                        at
System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1 eventHandler, Object sender, T eventArgs)
                                                        at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CreateRunspace()
                                                        at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.OpenHelper()
                            ErrorRecord               :
                                Exception             :
                                    Type                      : System.Management.Automation.RemoteException
                                    SerializedRemoteException : System.Management.Automation.PSInvalidOperationException:
Cannot create or open the configuration session PowerShell.7. --->
System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server localhost failed with the
following error message : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2689860592"
Machine="localhost"><f:Message><f:ProviderFault provider="PowerShell.7"
path="C:\Windows\system32\PowerShell\7.3.0\pwrshplugin.dll"></f:ProviderFault></f:Message></f:WSManFault> For more information,
see the about_Remote_Troubleshooting Help topic.
                                                                at
System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
                                                                at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult asyncResult)
                                                                at System.Management.Automation.RemoteRunspace.Open()
                                                                at
System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String configurationName, PSHost host)
                                                                --- End of inner exception stack trace ---
                                                                at
System.Management.Automation.HostUtilities.CreateConfiguredRunspace(String configurationName, PSHost host)
                                                                at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreatedForTypeTable(Object sender, RunspaceCreatedEventArgs
args)
                                                                at
System.Management.Automation.ServerRunspacePoolDriver.HandleRunspaceCreated(Object sender, RunspaceCreatedEventArgs args)
                                                                at
System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1 eventHandler, Object sender, T eventArgs)
                                                                at
System.Management.Automation.ExtensionMethods.SafeInvoke[T](EventHandler`1 eventHandler, Object sender, T eventArgs)
                                                                at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CreateRunspace()
                                                                at
System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.OpenHelper()
                                    ErrorRecord               : …
                                    Message                   : Cannot create or open the configuration session PowerShell.7.
                                    HResult                   : -2146233087
                                CategoryInfo          : InvalidOperation: (:) [], PSInvalidOperationException
                                FullyQualifiedErrorId : InvalidOperation
                            Message                   : Cannot create or open the configuration session PowerShell.7.
                            HResult                   : -2146233087
                        CategoryInfo          : InvalidOperation: (:) [], PSInvalidOperationException
                        FullyQualifiedErrorId : InvalidOperation
                    Message                   : Cannot create or open the configuration session PowerShell.7.
                    HResult                   : -2146233087
                CategoryInfo          : InvalidOperation: (:) [], PSInvalidOperationException
                FullyQualifiedErrorId : InvalidOperation
            Message                   : Cannot create or open the configuration session PowerShell.7.
            HResult                   : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], PSInvalidOperationException
        FullyQualifiedErrorId : InvalidOperation
    Message                   : Cannot create or open the configuration session PowerShell.7.
    HResult                   : -2146233087
TargetObject          : Win10Test
CategoryInfo          : OpenError: (Win10Test:String) [], RemoteException
FullyQualifiedErrorId : PSSessionStateBroken
Environment data
PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduzieren Sie das Problem mit Enable-PSRemoting, Invoke-Command und Set-PSSessionConfiguration unter Verwendung der PowerShell.7-Konfiguration, zuerst als Administrator und anschließend als Mitglied von Remote Management Users. Der Payload nennt keine Quelldatei und keinen Test; abgeschlossen ist die Aufgabe, wenn ein Nicht-Administrator PowerShell.7 öffnen und den gezeigten Invoke-Command erfolgreich ausführen kann, ohne dass der WSMan-Provider-Fehler auftritt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
cli, networking
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.