There is no built-in utility to do this, but you could accomplish it with a scheduled revoke of the user's permissions and then a scheduled change to put the permissions back.
In Task Scheduler, you would create a basic task of cacls filename /r WolfyShare
at 23:00. This revokes all access permissions of the user.
Then to restore access, you would reverse the change with cacls filename /g WolfyShare:f
at 12:00.
You would create similar tasks for the other user at the corresponding times.
To disconnet a user's session, you could use net session \\computername /delete
, however this method would require the user always be using the same PC.
Read about cacls.exe on Technet.
Read about how to disconnect a user using net session
.
Thanks for this! I did it as you tell me (with Icacls), but in case that this user is already using a file (like video clip,...) this will not stop the use of this file... any ideas why? I also disabled cache (/cache:none) – Wolfy – 2013-03-06T13:29:48.483
I updated my answer – Moses – 2013-03-07T20:02:12.260