Disable windows file shares without losing share config
Two methods I can think of that don't require modifying the shares:
- Disable the Server service.
OR
- Unbind File and Printer Sharing on the NIC.
Here's what I'd do.
- Backup the
HKLM\System\CurrentControlSet\Services\LanManServer\Shares
registry key and subkeys - Delete any shares you want to "disable".
- Restart the "Server" service.
- Restore the shares from the registry backup to "enable" them again.
It's a bit heavy-handed, but I'd prefer that to @TheCleaner's suggestion of changing permission because it makes the shares gone w/ no chance of anybody accessing them, "Domain Admins" member or otherwise.