Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Jan 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Service to Log Off (VB Studio 2005)

    I am looking for a way to log off users who are connected to a shared drive on a server with open files. Reason behind this is whenever I need to backup the server, there are certain applications that need to be closed before the backup to start. Therefore if a user has a file open that uses the application then the backup will never start. I thaught of using the TS command within a batch file to log everyone off, but this only works if they are connected to the machine remotely. In most cases they are not. Instead they map to the shared drive and use the files.

    To clarify, I would like to log off those users who have open files on the servers shared drives.

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Service to Log Off (VB Studio 2005)

    Can you shell the command NET SESSION /DELETE?

    StuartR

  3. #3
    Lounger
    Join Date
    Jan 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Service to Log Off (VB Studio 2005)

    I could use this feature but I wanted to utilize VB 2005. Is there a way to get access/reference to the Computer Management and Services console through VB?

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Service to Log Off (VB Studio 2005)

    I don't know how to do this, but hopefully someone will have a suggestion for you.

    StuartR

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Service to Log Off (VB Studio 2005)

    Hi Ricky

    To do this, you'll need the session ID for the user you're trying to log off, then call the WTSLogoffSession API.

    Take a look at this URI: WTSLogoffSession API call.


    This should put you in the right direction
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •