File tree 1 file changed +2
-0
lines changed
1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -862,12 +862,14 @@ Function DisableSharingMappedDrives {
862
862
# Disable implicit administrative shares
863
863
Function DisableAdminShares {
864
864
Write-Output " Disabling implicit administrative shares..."
865
+ Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" - Name " AutoShareServer" - Type DWord - Value 0
865
866
Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" - Name " AutoShareWks" - Type DWord - Value 0
866
867
}
867
868
868
869
# Enable implicit administrative shares
869
870
Function EnableAdminShares {
870
871
Write-Output " Enabling implicit administrative shares..."
872
+ Remove-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" - Name " AutoShareServer" - ErrorAction SilentlyContinue
871
873
Remove-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" - Name " AutoShareWks" - ErrorAction SilentlyContinue
872
874
}
873
875
You can’t perform that action at this time.
0 commit comments