Results 1 to 7 of 7

Thread: How to force user log off

  1. #1
    Join Date
    Nov 2005
    Posts
    36

    How to force user log off

    I’m the administrator of Windows Server 2008 / Domain. We have Several users and workstations connected to this domain. I received a message from my boss to disable account of one of our user who is already logged in at the moment. I tried doing it normally as we disable the accounts from domain but it is not working for him. As that particular user is already logged in and
    even the screen saver is on, he is still able to log in back.

    Can anybody please tell me how can I force him to log off and how can I disable his account immediately in this situation? Help appreciated.

  2. #2
    Join Date
    Sep 2004
    Posts
    113

    Re: How to force user log off

    Yes, it is possible to log off any user in this situation. You can do it easily by remote control. Listing 8.24 contains a script that shuts down a computer. To carry out this task, the script must perform the following steps:
    • Create a constant named SHUTDOWN and set the value to 1. This constant specifies that the computer should be shut down.
    • Create a variable to specify the computer name.
    • In Listing 8.24, the computer name is set to "." which will result in the local computer being shut down. To shut down a remote computer, simply set the variable to the appropriate computer name.
    • Use a GetObject call to connect to the WMI namespace root\cimv2, and set the impersonation level to "impersonate."
    • Use to the ExecQuery method to return a collection consisting of all instances of the Win32_OperatingSystem class.
    • The Shutdown privilege must be specified as part of the GetObject moniker. If it is not, the script will fail and the computer will not be shut down. The Shutdown privilege is required to shut down a computer by using WMI. However, including the privilege within the moniker does not ensure that the script will succeed. In addition to inclusion of the privilege within the moniker, the user under whose credentials the script is running must also have permission to shut down the computer.
    • For each operating system in the collection, use the Win32Shutdown method, specifying the constant SHUTDOWN (with the value 1) for the method parameter.


    To shut down, but not power off, the computer, use the value 1 as the method parameter. Other values will result in other actions. For example, the value 0 will log the user off but will not shut down the computer.

    For more information on the same, check this: http://technet.microsoft.com/library/ee156545.aspx

  3. #3
    Join Date
    Sep 2004
    Posts
    105

    RE: How to force user log off

    Hello Fedlix. I have bit confusion from your post. You said "User is logged in and even the screen saver is on." What you actually mean by that? Is it the user is actually logged out or is the screen saver just coming on?

  4. #4
    Join Date
    Nov 2005
    Posts
    36

    RE: How to force user log off

    Yes, the user is still logged in, whenever i try forcing loggin him off the screen saver came out. And he is still able to log in.

  5. #5
    Join Date
    Sep 2004
    Posts
    69

    RE: How to force user log off

    I dont think is it possible to force log off to a user from domain controller. In case the account is disabled he wont be able to log on to another machine. Apart from technical method, why dont you just go there and log him off physically from his system as you go order from your and his boss.

  6. #6
    Join Date
    Sep 2005
    Posts
    1,476

    Re: How to force user log off

    Hello Fedlix.

    Just give a try to this:

    shutdown -r -m \\pc001

    this will reboot pc001 hence get the user out of the pc. Thats so simple.

  7. #7
    Join Date
    Dec 2008
    Posts
    1

    Re: How to force user log off

    If it is remote login, then it is possible.
    We can go to the server command promt, 'query session' and logoff the user

Similar Threads

  1. Force User Logoff from windows server
    By Russyan in forum Active Directory
    Replies: 4
    Last Post: 10-01-2014, 10:39 AM
  2. Force user log off settings on Windows 2008 R2
    By N^GarJuna in forum Windows Server Help
    Replies: 6
    Last Post: 23-02-2012, 07:43 AM
  3. force user to change password on next logon
    By Chad Gross in forum Active Directory
    Replies: 5
    Last Post: 06-07-2011, 08:47 AM
  4. Force user to log off network
    By Rondo in forum Windows Server Help
    Replies: 6
    Last Post: 19-01-2009, 06:14 PM
  5. How to force User log off when time expires?
    By TheTurner in forum Windows Security
    Replies: 2
    Last Post: 28-07-2007, 06:32 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,711,623.05405 seconds with 17 queries