Skip to content

Commit d773b93

Browse files
committed
Make DisableAdminShares apply properly on WinServer, fixes Disassembler0#317
1 parent 4f0f07c commit d773b93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Win10.psm1

+2
Original file line numberDiff line numberDiff line change
@@ -862,12 +862,14 @@ Function DisableSharingMappedDrives {
862862
# Disable implicit administrative shares
863863
Function DisableAdminShares {
864864
Write-Output "Disabling implicit administrative shares..."
865+
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareServer" -Type DWord -Value 0
865866
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -Type DWord -Value 0
866867
}
867868

868869
# Enable implicit administrative shares
869870
Function EnableAdminShares {
870871
Write-Output "Enabling implicit administrative shares..."
872+
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareServer" -ErrorAction SilentlyContinue
871873
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -ErrorAction SilentlyContinue
872874
}
873875

0 commit comments

Comments
 (0)