Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinRM Plugin Registration and Modification #1193

Closed
mirichmo opened this issue Jun 23, 2016 · 10 comments
Closed

WinRM Plugin Registration and Modification #1193

mirichmo opened this issue Jun 23, 2016 · 10 comments
Assignees
Labels
Area-SideBySide related to ability to run PS7 side-by-side with WinPS or different versions of PS7 Issue-Enhancement the issue is more of a feature request than a bug OS-Windows Resolution-Fixed The issue is fixed.

Comments

@mirichmo
Copy link
Member

mirichmo commented Jun 23, 2016

Overview

On Windows, the PowerShell installer will not automatically enable receiving incoming requests. The feature shall be activated as a post-install step that requires Administrator-level authorization (due to the WinRM plugin's System32 placement requirement).

Changes Required

Enable-PSRemoting Changes

Cmdlet implementation should be changed to also

  1. Copy pwrshplugin.dll from %ProgramFiles%\PowerShell\ (aka $PSHOME) to %windir%\System32\PowerShell
  2. Create a the necessary plugin configuration file in %windir%\System32\PowerShell
  3. Register the plugin as a WinRM endpoint (Proposed name = PowerShell.)

Get-PSSessionConfiguration should work with these changes.

@mirichmo mirichmo added OS-Windows Area-SideBySide related to ability to run PS7 side-by-side with WinPS or different versions of PS7 labels Jun 23, 2016
@HemantMahawar HemantMahawar modified the milestones: Future, 6.0.0-alpha.9 Jul 13, 2016
@alexandair
Copy link
Contributor

alexandair commented Jul 20, 2016

How is Get-PSRemoting different than Get-PSSessionConfiguration?

UPDATE: Is this expected?
PS C:> Get-PSSessionConfiguration
Get-ChildItem : Cannot find drive. A drive with the name 'WSMan' does not exist.

@HemantMahawar
Copy link
Contributor

HemantMahawar commented Jul 20, 2016

@alexandair ... that was left over from previous thinking. Cleaned it up .. cc @mirichmo

@mirichmo
Copy link
Member Author

mirichmo commented Aug 7, 2016

Due to time constraints for the upcoming release, I implemented a partial solution to this issue. The script Install-PowerShellRemoting.ps1 resides in $PSHOME for Windows releases and will automatically register the included plugin as a WinRM endpoint for PS remoting. The script must be run with Administrator rights because it copies the plugin dll into a versioned directory within System32.

This issue should remain open until I have time to implement the full solution.

@masaeedu
Copy link

Will the cmdlet have options to choose between SSH and WinRM?

@mirichmo
Copy link
Member Author

This issue only applies to Windows + WinRM. Adding support for SSH should be handled through a separate issue and would be a feature request. Please go ahead and file an issue for it if you think it would be useful as part of the overall SSH user experience.

@joeyaiello joeyaiello added the Issue-Enhancement the issue is more of a feature request than a bug label Sep 2, 2016
@mirichmo mirichmo modified the milestones: 6.0.0-alpha.13, 6.0.0 Nov 12, 2016
@mirichmo mirichmo modified the milestones: 6.0.0-beta, 6.0.0 Dec 15, 2016
@HemantMahawar HemantMahawar added this to Priority-Low in Remoting over WSMan Mar 16, 2017
@joeyaiello joeyaiello modified the milestones: 6.0.0-beta2, 6.0.0-beta1 Mar 20, 2017
@SteveL-MSFT SteveL-MSFT modified the milestones: 6.0.0-beta, 6.0.0 May 15, 2017
@joeyaiello
Copy link
Contributor

I believe that most of this logic is already encapsulated in Install-PowerShellRemoting.ps1, but we should bring it into Enable-PSRemoting.

daxian-dbw pushed a commit that referenced this issue Aug 8, 2017
Fixes #1193 for most scenarios. The remaining scenario to be addressed is the Nano Server bring-up scenario. To continue supporting that scenario, I left the Install-PowerShellRemoting script in place.

This change 
1. Ports Enable-PSRemoting and Disable-PSRemoting to PowerShell Core
2. Adds side-by-side PowerShell Core remoting support to the PSSessionConfiguration cmdlets and PSRemoting cmdlets.
3. Ports PSSessionConfiguration tests

This change also introduces a behavioral difference. The PSRemoting and PSSessionConfiguration cmdlets are now context-sensitive and only work for endpoints that match the PowerShell type. For example, Get-PSSessionConfiguration, when running in PowerShell Core, will only return PowerShell Core WinRM endpoints. It will only modify PowerShell Core WinRM endpoints and cannot be used to configure Windows PowerShell endpoints.
@daxian-dbw
Copy link
Member

@mirichmo This issue was closed automatically after merging #2671. If this issue shouldn't be closed due the pending NanoServer scenario, feel free to re-open it.

@mirichmo
Copy link
Member Author

mirichmo commented Aug 8, 2017

The Nano Server Scenario (registering a different instance of PowerShell Core) is covered by the install script and that still exists. I filed #4528 to document this.

@iSazonov iSazonov added the Resolution-Fixed The issue is fixed. label Aug 9, 2017
@daxian-dbw daxian-dbw added the Documentation Needed in this repo Documentation is needed in this repo label Aug 9, 2017
@SteveL-MSFT SteveL-MSFT moved this from Priority-Low to Done in Remoting over WSMan Mar 18, 2018
@joeyaiello joeyaiello removed Documentation Needed in this repo Documentation is needed in this repo labels Oct 15, 2018
@BatmanAMA
Copy link

It sounds like this is resolved, however on a new install of powershell 6.1.1 (on WS 2016) enable-psremoting fails to register a powershell.6 (or powershell.6.1.1) endpoint. I need to still use the install-powershellremoting.ps1 script.
Is this intended? It may be worth clarifying in the docs what the psremoting setup procedure is and removing the reference to this issue. Let me know what you're thinking and I'll happily go submit a pull request to the docs repo.

@benmccallum
Copy link

After installing PS 7.1 and in the installer checking "Enable Remoting" or whatever the option was I couldn't remote. Full details on this SO post here.

I found a kind of solution which is giving the windows user I'm trying to connect with Full Control of C:\Windows\System32\PowerShell\7.1.0, but I'd obviously like to know if something else has gone wrong and it seems kinda of related to what this installer was doing though I used Enable-PSRemoting in a 7.1 isntance so not sure...

Any help would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-SideBySide related to ability to run PS7 side-by-side with WinPS or different versions of PS7 Issue-Enhancement the issue is more of a feature request than a bug OS-Windows Resolution-Fixed The issue is fixed.
Development

No branches or pull requests