Although, there is no clicky way to pause a Windows servers shares, there is a bit more unconvenient way to prevent users from accessing your servers shares:
- Fire up a registry editor and navigate to HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
- Export all shares you want to reopen again later
- Delete all shares you want to pause and close the registry editor
- Restart the service called “Server“
et voila, you’re done.
If you work in a ActiveDirectory based environment and all your clients are connected to the domain, you might not have to deal with manually map home drives and other resources.
However, if some of your clients are not connected to the domain, but need access to domain resources, you probably noticed that it can be pretty annoying having service calls because of forgotten network paths and locked accounts.
To encounter that problem, I wrote a quick and dirty script, which gives the user a basic dialogue driven netdrive-mapper, so your service desk gets rid of the most basic calls.
ECHO Removing all available mappings...
NET USE * /D
ECHO Attempting to connect to SERVER and map your homedrive...
SET /P USER=Please enter your username (email@example.com):
NET USE U: \\server.domain.local\%USER:~0,-13%$ /USER:%USER% /PERSISTENT:NO
ECHO Attempting to connect to SERVER and map your Groupdrives...
SET /P GROUP1=Please enter your main Group:
NET USE V: \\server.domain.local\%GROUP1% /PERSISTENT:NO
SET /P CONTINUE=Add another Groupdrive? (y or n)
IF /I '%CONTINUE%'=='y' GOTO GROUP2
IF /I '%CONTINUE%'=='n' GOTO PUB
ECHO "%CONTINUE%" is not valid. Going to map public drives GOTO PUB
SET /P GROUP2=Please enter your second Group:
NET USE W: \\server.domain.local\%GROUP2% /PERSISTENT:NO
ECHO Attempting to connect to SERVER and map public drives...
NET USE p: \\server.domain.local\public /USER:%USER% /PERSISTENT:NO
ECHO Attempting to connect to SERVER and map printers...