From d773b93d6fdcc829ddbb0322376a3fca25d2bd78 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 15 Jul 2020 18:58:33 +0200 Subject: [PATCH] Make DisableAdminShares apply properly on WinServer, fixes #317 --- Win10.psm1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Win10.psm1 b/Win10.psm1 index cba3579..af6fb07 100644 --- a/Win10.psm1 +++ b/Win10.psm1 @@ -862,12 +862,14 @@ Function DisableSharingMappedDrives { # Disable implicit administrative shares Function DisableAdminShares { Write-Output "Disabling implicit administrative shares..." + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareServer" -Type DWord -Value 0 Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -Type DWord -Value 0 } # Enable implicit administrative shares Function EnableAdminShares { Write-Output "Enabling implicit administrative shares..." + Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareServer" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -ErrorAction SilentlyContinue }