Link to home
Start Free TrialLog in
Avatar of a222493
a222493

asked on

Disable a file share

Hi,

I would like to temporarily disable a file share.  Users at workstations connect to a file share and open a file.  This connection needs to be closed before a nightly job runs.  So, I would like to run a scheduled job to disable/re-enable the share.  (I don't what to lose the security privelages that are associated with the share, or I'd like to easily reset them...)

Net Share ???

Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Any particular reason you're using share level permissions?
If you forget about share level permissions and stick to NTFS permissions, you won't have problems.
Avatar of robrandon
robrandon

What about restarting the workstation service?  I think that will drop all the connections to the server, but I'm not 100% sure on that.
Server Service.
ASKER CERTIFIED SOLUTION
Avatar of Leandro Iacono
Leandro Iacono
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can also try the NET SESSION command.

Avatar of a222493

ASKER

How could I use NET SESSION?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of a222493

ASKER

I hadn't checked, but we were not using share permissions, so I was able to use net share /delete.  Then for good measure, I used the NET SESSION /D to get rid of any locks.  For auditing purposes, I used NET FILE which lists everyone connected...
Glad we could help you out mate :D