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 ???

a222493Asked:
Who is Participating?
 
Leandro IaconoSenior Premier Field EngineerCommented:
You could do this with Net Share Command...

http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/e353ec49-e1c2-46b3-b294-69f885774c8c.mspx

Possibly create a script and schedule it to run a specific hours?

Good luck mate ...

UICE
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Any particular reason you're using share level permissions?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
If you forget about share level permissions and stick to NTFS permissions, you won't have problems.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
robrandonCommented:
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.
0
 
robrandonCommented:
Server Service.
0
 
robrandonCommented:
You can also try the NET SESSION command.

0
 
a222493Author Commented:
How could I use NET SESSION?
0
 
robrandonCommented:
Net session will disconnect the computers that are connected through your file shares.

I believe you can invoke NET SESSION /D and it will close all of the open session.  You would then have to schedule that command to run at whatever time you want.
0
 
a222493Author Commented:
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...
0
 
Leandro IaconoSenior Premier Field EngineerCommented:
Glad we could help you out mate :D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.