none
AUTO-DISCONNECT SCRIPT FOR FILE SHARING RRS feed

  • Question

  • I am looking to find a script that will auto-disconnect users that are inactive for a certain amount of time. I have users that access files in a SQL database and when they are inactive for 1.5 hours I want the session to be terminated. Our job cost company said that it is not possible to enter a script into the SQL database to this. They told me I would need to do this on the hardware level. I do not believe that. I am not sure what version of SQL I am running but the server is 2003 R2 and the end users are using Windows 7 Pro 64bit. I tried running "net config server /autodisconnect:90" but it does not "kick" the users. Please advise.

    -Don`t Panic-

    Thursday, March 13, 2014 3:10 PM

Answers

  • Still a management problem.  If you have no control over who can log into a database then you have no control over licenses.  You hack will only further aggravate the issue.

    There is no way short of killing the program to accomplish this.


    ¯\_(ツ)_/¯

    • Marked as answer by Ellinas1990 Thursday, March 13, 2014 5:18 PM
    Thursday, March 13, 2014 5:14 PM

All replies

  • A database is not a file connection.   Connections to SQLServer are never kept open.  They are cached and opened when required.  A master connection may appear int eh database monitor but it is benign.

    Forget about what you are trying to do./autodisconenct is for mapped drives and file server connections only. It is an SMB command.  SQL is a TCPIP connection.

    The way to terminate all connections is to close the program. Why would you care? It costs nothing for a user to keep a program open.  SQLServer is designed to work this way.

    This is not a scripting problem and cannot be resolved with a script. It is a user management issue.


    ¯\_(ツ)_/¯

    Thursday, March 13, 2014 4:25 PM
  • I want them to be terminated because we have insufficient licenses for the program that hosts the database and upper management does not want to buy any additional. The users must not be connecting to the SQLServer then because when I kill a users session through the server management the program kicks them out and they need to log back in. I want that feature to be automated and set for 1.5 hours of inactivity. I was in the server forum and they directed me here.

    -Don`t Panic-

    Thursday, March 13, 2014 5:09 PM
  • Still a management problem.  If you have no control over who can log into a database then you have no control over licenses.  You hack will only further aggravate the issue.

    There is no way short of killing the program to accomplish this.


    ¯\_(ツ)_/¯

    • Marked as answer by Ellinas1990 Thursday, March 13, 2014 5:18 PM
    Thursday, March 13, 2014 5:14 PM
  • Thank you

    -Don`t Panic-

    Thursday, March 13, 2014 5:17 PM