mirror of
https://github.com/Disassembler0/Win10-Initial-Setup-Script.git
synced 2026-01-10 14:37:55 -05:00
Make DisableAdminShares apply properly on WinServer, fixes #317
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user