There are two ways you can do this easily via a batch script:
NET SESSION \\computername /delete
or
SC RESTART LanmanServer
The first terminates all sessions for the specified computer name. The latter stops and restarts the file server, which would effectively terminate all sessions.