At first, happy new year 2019 to you all!

I have been thinking what topic would be my first blog post of year 2019, maybe something about ConfigMgr or Intune? Turns out, neither! In these two days, I have been make a idle notification/action tool, because I have some needs log off user from machine if user is not using it for xx minutes, it needs to have popup notifications, custom text, time out features, and most important: Do some actions, example log off the user. Basically this is useful for public use machines or shared PCs, Kiosk PCs.

So here I am, making my own tool again. This is how it looks like:

How does it work

After installation, it puts SCConfigMgr Idle Notification.lnk shortcut in folder C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp, when user logon, it runs SCConfigMgr Idle Notification.exe in background, it checks idle status every 10 seconds. After installation, you have to log off then log in again, so that SCConfigMgr Idle Notification.exe will automatically start. Based on your configuration, it will popup a custom notification when reach to xx minutes idle time, this notification will stay on your desktop xx minutes unless you click OK. Idle time will be reset to 0 if someone use mouse or keyboard.

What this tool can do and how to configure it

  • All the properties are stored in settings.xml file, which can be configured as how you like.
  • You will need to put all these three files in one folder, then create a shortcut for SCConfigMgr Idle Notification.exe
  • Put the shortcut to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp folder, so that this app will start automatically when user login.

 Here are the configurable properties

  1. TITLE
    Well, title is tile, by default it is SCConfgMgr
  2. IMAGEFILE
    You can configure your own image, it supports max. 300 x 80 pixels jpg file.  You must copy the file to same installation folder as this tool, configure property IMAGEFILE value to your logo image file name. Default logo image is our SCConfigMgr banner.
  3. IDLETIMEMINUTES
    Here you can configure idle time in minutes. Default is 5. I have hard coded that check each 10 seconds idle status, so there are some delays.
  4. BODYTEXT
    This is the text saying This computer has not been used for 5 minutes, you will be logged off soon. If you wish to continue use it, please click ‘OK’
    NOTE: Please don’t input too much characters, otherwise it will push log off time and OK button out of notification box. 
  5. COUNTDOWNMINUTES
    This is how long popup notification will stays on your desktop by minutes. Default is 2.
  6. DEADLINETEXT
    This is the text saying Log off time, details of log off time is calculated in the app, I made this property just in case you want to change it to your local language.
  7. DOACTION
    I was originally only want log off the user, but I didn’t hard coded this one, you can configure other commands. Default is shutdown.exe /l /f, this command will force log off current user.
  8. STARTTIMEMINUTES
    You can use this configure what time do you want it checks idle time, example if you want starts at 8am, use value 480, calculate 8 time 60 minutes, so it’s 480. Default is 0
    You can use PowerShell calculate this value as well, example:

    # 8AM
    (New-TimeSpan -Hours 8).TotalMinutes
    
    # 5PM
    (New-TimeSpan -Hours 17).TotalMinutes
  9. DURATIONMINUTES
    Use this property configure how long do you it checks idle time since StartTime. Example, you want configure it check idle time from 8am to 5pm, configure STARTTIMEMINUTES as 480, DURATIONMINUTES 540. Default is 1440
    You can use PowerShell calculate this values as well, example

    # from 8AM to 5PM
    (New-TimeSpan -Hours (17-8)).TotalMinutes
    
    # from 10PM to next day 8AM
    (New-TimeSpan -Hours (24-22+8)).TotalMinutes
  10. DETECTLOCK
    Default is False, if set it to True, it will detect locked status, and it will not do anything if user locked the machine. But if user locked the machine after idle notification appears and didn’t choose OK, it will still log off the user.
  11. DETECTSLIDESHOW
    Default is False. If set it to True, it will detect if PowerPoint SlidesShow is on, it will not anything. However, if user start SlideShow after notification appear and didn’t choose OK, it will still log off the user. Set it to False if you don’t want the dectection
  12. PROCESS-NAME
    In here you can configure process names, if the process is running, Idle tool will not do any actions. You can add more processes by adding <Name>your process</Name>

Sample settings.xml

Download

You can download this tool from TechNet: Click here

Update History:

  • Version 3.0.3.0 (April.18.2019) Fixed bug that popup windows doesn’t work if there are special characters (Thanks for Maurice’s help)
  • Version 2.0.1 (April.03.2019) Fixed a bug that action didn’t run.
  • Version 2.0.0 (March.31.2019) Added detect running process. Note, I no longer offer the ready msi package, you will have to pack all the files and deploy them.
  • Version 1.0.6 (Jan.25.2019) Fixed a bug that body text property was not applied.
  • Version 1.0.5 (Jan.11.2019) Added property DETECTSLIDESHOW. Default is True, if PowerPoint SlidesShow is on, it will not anything. However, if user start SlideShow after notification appear and didn’t choose OK, it will still log off the user. Set it to False if you don’t want the dectection
  • Version 1.0.4 (Jan.10.2019) Added Padding in textbox, so that text are not in the edge of textbox
  • Version 1.0.3  (Jan.10.2019) Added property DETECTLOCK, Default is True, it will not do anything if user locked the machine. However, if user locked the machine after notification appear and didn’t choose OK, it will still log off the user. Set it to False iif you don’t want the dectection
  • Version 1.0.1  (Jan.10.2019) Added two properties, can now use between time frames
  • Version 1.0.0  (Jan.07.2019) First version.

(5773)

comments
  • david hood
    Posted at 14:25 January 9, 2019
    david hood
    Reply
    Author

    Thats neat. I could really use this for a client, but I would need some method for it to only check after a time. e.g. only perform this check from 7PM onwards – so it didn’t interfere with folk working at night. Possible?

    cheers

    Dave

    • Zeng Yinghua
      Posted at 00:26 January 10, 2019
      Zeng Yinghua
      Reply
      Author

      Hello Dave, I added two more properties and updated the msi package, would you like try again? Details are in the post.
      Regards, Sandy

  • Chris G
    Posted at 15:18 January 9, 2019
    Chris G
    Reply
    Author

    Great idea. Thank you. How do you check for idle time?

  • Gregg Cooper
    Posted at 17:22 January 10, 2019
    Gregg Cooper
    Reply
    Author

    Hi, this tool is exactly what I have been after for quite a while. My clients have a tendency to leave their machines unlocked for an excessive amount of time.

    Can I ask, would this still log the user off if the machine is locked? I would like the tool to log people off if they have left it in an insecure state, but if its been locked, do nothing.

    As a suggestion, this tool would be even more amazing if it had two actions configurable at two different idle times. ie, lock machine after 5 mins idle, then log user off after an additional 5 mins idle.

    Hi, fantastic idea. Been looking for something like this for a while. I have a few enquiries.

    1. Is it possible for the app to detect if a video or PowerPoint is full screen? At the moment it ignores this. Windows has a built-in ability to not start an idle timer if it detects either of these.

    2. Is it possible for the app to have two actions based on two different idle times? ie, After 5 minutes one command runs, then after another 5 mins, another command runs? I am thinking of a case where initially a machine will lock (I have tested this your app will accept the command “rundll32.exe user32.dll, LockWorkStation”) and then once the second idle timer is triggered, it logs the user off.

    3. Is it possible to add some padding to the notification box text so it doesn’t start right at the edge of the box?

    Thank you and apologies if that’s quite a lot of requests!

    • Zeng Yinghua
      Posted at 00:15 January 11, 2019
      Zeng Yinghua
      Reply
      Author

      Hello Gregg, I combine your two comments in to one. I have updated my tool, now it can detect locked status, PowerPoint Slide Show and fix the padding. I am not using Windows idle, only idle detection I am using is user input. I see you want use first action lock the machine in x minutes, then after x minutes log off the user, but why not use GPO or Intune configure “Interactive logon>Machine inactivity limit”?

      Or are you looking for not using GPO or Intune for inactivity limit, but using this tool to do so. So if user locked the machine by themselves, this tool do nothing. But the tool locked machine in like 5 mins idle, then maybe 60 min. later it log off user? Just curious in what kind of scenario you are having. 🙂

      I made this tool, original idea is for shared PC and Kiosk PC, so that it log off the user and delete also profile as well, keeps personal data secured, just in case people forget log off from public computers. 🙂

      Regards, Sandy

  • Altimar
    Posted at 21:05 January 17, 2019
    Altimar
    Reply
    Author

    Thank you! Usually 10% of our 15k computers remain powered on overnight and this software will help us to shutdown idle computers. Here is some suggestions:

    1 – Could you allow only 1 instance per user? I’m going to enforce the start in multiple ways (start folder, reg keys and so on) and more than 1 instance running maybe will cause some problems…

    2 – Could you allow the running of powershell scripts? I would like to check if some apps (MS Word, for example) is running before logging off/shutdown computer, add some logging and so on. This could be helpful to avoid angry users 🙂

    I’m currently using powershell.exe -File C:\test\script.ps1 -ExecutionPolicy ByPass, but it would be nice just point a powershell script in settings.

    • Bill
      Posted at 23:03 March 10, 2019
      Bill
      Reply
      Author

      I wanted to build on the previous comment’s point #2.

      It’d be nice if in the settings we could define a list of processes that if running would not log off the user. Some of our labs have users doing extended rendering or processing so if certain executables are running we’d prefer to not do the logoff.

  • Tim
    Posted at 17:43 March 28, 2019
    Tim
    Reply
    Author

    Best creation of 2019!!

    2 questions:

    How do you recommend deploying this tool via SCCM after the logo & XML files have been customized?

    Any plans to add an option to run scripts before logoff??

    • Zeng Yinghua
      Posted at 02:55 March 31, 2019
      Zeng Yinghua
      Reply
      Author

      Hello, I no longer offer the msi ready made package. I would use PSAppDeployToolkit to package these files and deployed them. The action is actually using PowerShell command Invoke-Expression, the settings.xml DOACTION property define the value of $action, you can put in your script run some actions then logoff, right? The tool is not for too complex usage. 🙂

      You can download the package again from TechNet, I have packaged those files using PSAppDeployToolkit, but you will need to put your own logo.jpg in file folder.

  • Adam
    Posted at 16:42 November 4, 2019
    Adam
    Reply
    Author

    How does one go about deploying this via Intune?

    • Zeng Yinghua
      Posted at 20:07 November 24, 2019
      Zeng Yinghua
      Reply
      Author

      You can configure all the settings that you like, then package it as IntuneWin32 apps.

  • Leave a Reply to Tim
    Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.