I need a process that will automatically disconnect all users connected to a share on a server when it is executed. Ideally, I would like to do this with .NET.
I need this process to have the same functionality as the following manual process:
-On Windows Server 2003, I go to Computer Management --> Shared Folders --> Sessions, right click "sessions" and then choose "Disconnect all sessions".
Alternatively, this can be done at a command prompt with:
NET SESSION /DELETE /y
I need to automate this to run automatically at a specified time.