Task scheduler log off user or run a scheduled backup：
I have a group of users that share 3 machines throughout multiple shifts, but users would forget to log off after their shift and head home. Thus, the computer were either locked, or running slow. I couldn't find a way in Task Scheduler to force log off a user after being idle for X amount of time. Is there any easier way?
Task scheduler can help you perform unattended tasks or when you are likely to forget to do something. But why not find a way to set task scheduler log off user? This is because the log off trigger is only available in earlier version of Windows and it's not included in the lastest version.
Then, how do we set task scheduler log off user? Some users try the Task scheduler "On disconnect from user session" trigger to achieve this goal, but it's not reliably triggering on user logout after testing.
Is there really no way? No, it is not true. We find some working ways in diffrent forums, such as, using shutdown.exe in the task scheduler or the event ID 4647, set shutdown scripts in the group policy. They are will be introduced in the next part.
Except for simply logging off users to prevent computer from being locked or running slow, other users may want to run a schedule backup task like the following case. At this time, you can try a professional backup software integrated with log off event trigger.
"I am running a Windows Vista (no gpedit.msc unfortunately) computer and I want to run a backup at logoff. So, when the user tries to shutdown the computer, I want to run a .bat file which executes the backup. The shutdown process must wait until the process is finished, and turn the computer off only then. How can I do this? I have tried the several solutions but none of them worked."
Here you will learn two ways in Task Scheduler, namely using shutdown.exe and event ID.
Method 1: Set Task Scheduler log off user using shutdown.exe
To perform Task scheduler log off users, you can choose to start with create basic task or create task. The first is quick way to set a schedule common task while the second one has more advanced settings. Here we will take "Create Task" as an example to show you the entire process.
Step 1. Press Win + S and type task scheduler in the search box. Then, select it.
Step 2. Select Create Task under the Actions tab.
Step 3. Type a name of this log off user task. Then, type Will log off a user when idle for 1 hours in the description box. After that, check the securty options, Run only when user is logged on and Run with highest privileges.
Step 4. Click Triggers > New > At log on/On idle. Please keep the default settings to any user while setting At log on trigger.
Step 5. Click Actions > New > Start a program. Then, type shutdown.exe at the Program/script box and add /I agreement.
Step 6. Click Conditions, tick Start the task only if the computer is idle for and set the idle time you expect.
Step 7. Click Settings, tick the following 3 options and set the time, namely, If the task fails, restart every, Stop the task if it runs longer than, If the running task does not end when requested, force it to stop.
Note: If the user log off has any open file, it will not be saved.
Method 2: Set Windows 10 log off using event ID
Here you will use Create Task action in the Task scheduler. Also, you can use Create Basic Task. It depends all on your needs.
Step 1. Open task scheduler. Then, click Create Task to enter its window.
Step 2. Clik Triggers > New > On an event. Then, in the Settings section, select the log Security and enter the Event ID 4647.
Step 3. Set other advanced setings per your needs. Then, click OK to save this task.
Note: This is best intended for quick executions, because this trigger does not pause or delay the logout process technically.
Also, you can schedule log off user without task scheduler. Here are two ways in total, including using group policy or registry.
Method 1: Set GPO scheduled task log off
Except for Task Scheduler, you still can use group policy to perform this task. The steps are below.
Step 1. Open group policy by typing gpedit.msc in the search box.
Step 2. Go to Computer Configuration > Windows Settings > Scripts (Startup/Shutdown) and then select Shutdown.
Step 3. Go to User Configuration > Windows Settings > Scripts (Logon/Logoff) and then select logoff.
Method 2: Set Windows task scheduler log off event using registry
Registry can be another choice if your computer does not support group policy. Try the following steps to create registry entries. Note that it will modify the registry, you need to create a backup in advance.
Step 1. Type notepad in the search box and then open it.
Step 2. Copy the following code and save it.
To perform a scheduled backup with log off event, the best way is to use a professional backup software for Windows 10/8/7/XP/Vista like AOMEI Backupper Professional. It supports 4 event triggers, namely, user logon, user logoff, system shutdown, system startup. And it can be used in all the backup solutions, including file backup, system backup, disk backup, partition backup.
In addition, you can use other backup settings, such as, daily/weekly/monthly schedule backup, wake the computer to run scheduled task, incremental or differential backup, backup scheme, etc. For more useful features, please download it to explore yourself.
Then, launch this software and start a schedule log off backup with the following steps. Please prepare a storage device and connect it to your computer. It supports HDD, SSD, USB flash drive, network drive or cloud drive like OneDrive etc.
Step 1. At the main console, click Backup and then System Backup.
Step 2. System drive and System Reserved Partition are selected automatically. Click the folder shapped button to choose destination backup location.
You can edit name of this task for better identification.
Step 3. Click Schedule at the lower left corner and then select Event triggers from the drop-down list.
Then, you will see all the event triggers. Choose User logoff option and click OK.
You can also enjoy these features:
Option: It allows you to comment on this task, compress or encrypt backup image, split image, etc.
Schedule: You can protect data continuously using daily/weekly/monthly schedule backup. Also, the option "Wake the computer to run scheduled task" is able to start computer 2 minutes before the task start.
Scheme: This optionwill assist you manage backup storage by deleting old backup images, thereby saving disk space.
Step 4. Click Start Backup to add this task or backup system immediately. Then, it will start the backup task automatically without user interference when you log off computer at the next time.
The way forward
Whether you want to use task scheduler log off user or run a scheduled backup with a user log off event, this article can help you. Note that a schedule backup can protect your data continuously so as to restore computer to an earlier date in the event of a disaster. If you still don't have one, please create one right now with a professional backup software.
AOMEI Backupper can be a great choice. It not only provides all kinds of backup solutions as well as backup settings, but also integrates with sync and clone features. Thus, you can use it to sync files between computer and drive, clone hard drives with different size, clone large HDD to smaller SSD, etc.