GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Single Thread Apartment required for Enable-WSManCredSSP and Disable-WSManCredSSP · Issue #3353 · PowerShell/PowerShell

Single Thread Apartment required for Enable-WSManCredSSP and Disable-WSManCredSSP #3353

New issue
Copy link
New issue
Copy link
Closed
Closed
Single Thread Apartment required for Enable-WSManCredSSP and Disable-WSManCredSSP#3353
Copy link
Assignees
SteveL-MSFT
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWaiting - DotNetCorewaiting on a fix/change in .NETwaiting on a fix/change in .NET
Milestone
6.0.0-GA

Description

@jeffbi
jeffbi
opened on Mar 17, 2017
Issue body actions

When given -Role Client, these cmdlets attempt to make use of the IGroupPolicyObject COM interface. IGroupPolicyObject requires that it be called from a Single Thread Apartment. STA is not supported in CoreCLR, so these cmdlets will fail when using the Client role.

This is the underlying cause of issue #2599.

The core folk have an existing issue for support of STA.

Steps to reproduce

Enable-WSManCredSSP -DelegateComputer ServerA.foo.xyz.com -Role Client -Force
or
Disable-WSManCredSSP -Role Client

Expected behavior

Perform the operation without error.

Actual behavior

Throws System.InvalidCastException when trying to cast an object to IGroupPolicyObject.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSRemotingProtocolVersion      2.3
GitCommitId                    v6.0.0-alpha.16-49-g97be759cc7bd33abbe220dd87...
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSEdition                      Core
CLRVersion
PSVersion                      6.0.0-alpha
BuildVersion                   3.0.0.0
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. iSazonov commented on Mar 17, 2017

    @iSazonov
    Ilya (iSazonov)
    on Mar 17, 2017
    Collaborator
    More actions

    Related #2969

  2. Ilya (iSazonov)
    added
    WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
    Waiting - DotNetCorewaiting on a fix/change in .NETwaiting on a fix/change in .NET
    on Mar 18, 2017
  3. iSazonov commented on Mar 18, 2017

    @iSazonov
    Ilya (iSazonov)
    on Mar 18, 2017
    Collaborator
    More actions

    CoreFX issue https://github.com/dotnet/corefx/issues/522 milestone is 1.0.0-rtm so I set "Waiting - NetStandard20"

  4. karelz commented on Mar 31, 2017

    @karelz
    Karel Zikmund (karelz)
    on Mar 31, 2017
    More actions

    Ilya (@iSazonov) what is exactly the expectation for .NET Standard 2.0? Are there any missing APIs? Or just missing capability of the runtime? -- in that case it would be more about .NET Core 2.0 than .NET Standard 2.0.
    Either way, I am not sure if we can make that happen in .NET Core 2.0 timeframe -- let's have that discussion in the new CoreFX issue. Is it something blocking PowerShell Core release? Is it something that PowerShell team (or community) is interested in contributing to CoreFX repo?

  5. iSazonov commented on Mar 31, 2017

    @iSazonov
    Ilya (iSazonov)
    on Mar 31, 2017
    Collaborator
    More actions

    Karel Zikmund (@karelz) We have some Issues here about this (2 or even more).
    I believe Dongbo Wang (@daxian-dbw) can comment in depth. It seems Dongbo Wang (@daxian-dbw) already open such Issue in CoreFX repo.

  6. daxian-dbw commented on Mar 31, 2017

    @daxian-dbw
    Dongbo Wang (daxian-dbw)
    on Mar 31, 2017
    Member
    More actions

    I didn't open a new issue in CoreFx repo on this topic. Currently we call ShellExecuteEx directly in MTA thread, it would have problems for some shell extensions that require COM, but it's fine for common uses, such as opening file exploere or a file based on its extension.

    However, this issue seems indicating that it's blocking our remoting scenario, Hemant Mahawar (@HemantMahawar) and Joey Aiello (@joeyaiello), can you please weigh in and see if this will block PowerShell Core 6.0 RTM release?

  7. iSazonov commented on Apr 2, 2017

    @iSazonov
    Ilya (iSazonov)
    on Apr 2, 2017
    Collaborator
    More actions

    In General, Windows still widely uses the COM as well as Forms that require STA. If .Net Core does not provide access to these subsystems, PowerShell will lose a lot of functionality. I would like to have Get-WmiObject.
    I do not dare to open the CoreFX Issue because I do not know these APIs deeply.

  8. alexandair commented on Apr 2, 2017

    @alexandair
    Aleksandar Nikolić (alexandair)
    on Apr 2, 2017
    Contributor
    More actions

    Ilya (@iSazonov) Why do you need Get-WmiObject? What about using Get-CimInstance instead?

  9. iSazonov commented on Apr 2, 2017

    @iSazonov
    Ilya (iSazonov)
    on Apr 2, 2017
    Collaborator
    More actions

    Aleksandar Nikolić (@alexandair) In this discussion, it is important that both cmdlets use COM.

  10. Steve Lee (SteveL-MSFT)
    self-assigned this
    on Jul 24, 2017
  11. Steve Lee (SteveL-MSFT)
    added this to the This milestone has been deleted milestone on Jul 24, 2017
  12. Aditya Patwardhan (adityapatwardhan)
    closed this as completedin #4336on Aug 10, 2017
  13. Ilya (iSazonov)
    added
    Resolution-FixedThe issue is fixed.The issue is fixed.
    on Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @SteveL-MSFT
    Steve Lee (SteveL-MSFT)

Labels

Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWaiting - DotNetCorewaiting on a fix/change in .NETwaiting on a fix/change in .NET

Type

No type

Projects

No projects

    Milestone

    • 6.0.0-GA

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.