File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 Invoke-webrequest -uri 'https://raw.githubusercontent.com/DarwinJS/Undo-WinRMConfig/blob/master/Undo-WinRMConfig/Undo-WinRMConfig.ps1' -outfile $env:public\Undo-WinRMConfig.ps1 ; & $env:public\Undo-WinRMConfig.ps1 -immediately
1010 Contributing New Undo Profiles: https://github.com/DarwinJS/Undo-WinRMConfig/blob/master/readme.md
1111
12- Disclaimer - this code was engineered and tested on Server 2012 R2.
12+ Disclaimer - this code was engineered and tested on Server 2012 R2 and Server 2016 .
1313
1414 Many windows remote orchestration tools (e.g. Packer) instruct you to completely open up winrm permissions in a way that is not safe for production.
1515 Usually there is no built in method nor instruction on how to re-secure it or shut it back down.
@@ -93,7 +93,8 @@ Function Setup-Undo {
9393 Write-Host "Undoing changes for Enable-PSRemoting, Enable-WSManCredSSP and winrm configuration commands"
9494
9595 Write-Host "Remove LocalAccountTokenFilterPolicy added by winrm configuration"
96- $regkeypath ='HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\system'
96+ #This key is symlinked into "Wow6432Node" - both locations are handled by one delete
97+ $regkeypath ='HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system'
9798 If (!((Get-ItemProperty $regkeypath).LocalAccountTokenFilterPolicy -eq $null))
9899 {Remove-ItemProperty -path $regkeypath -name LocalAccountTokenFilterPolicy}
99100
Original file line number Diff line number Diff line change 33<package xmlns =" http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd" >
44 <metadata >
55 <id >undo-winrmconfig-during-shutdown</id >
6- <version >1.1.6 </version >
6+ <version >1.1.8 </version >
77 <packageSourceUrl >https://github.com/DarwinJS/CloudyWindowsAutomationCode/tree/master/Undo-WinRMConfig</packageSourceUrl >
88 <owners >DarwinJS</owners >
99 <title >undo-winrmconfig-during-shutdown (Install)</title >
You can’t perform that action at this time.
0 commit comments