Windowsから一定時間操作がなくなったら自動的にログオフするフリーソフト” Idlelogoff”

私の本業はシステムエンジニアなんですが、これまで仮想デスクトップの案件を構築する事が多かったです。所謂、シンクライアント環境ですね。

 

今の時代、企業においてセキュリティ事故は大問題になる事が多いので、業務用パソコンはシンクライアントとして利用するケースが多いと思います。シンクラのメリットは、やはり、ローカルにデータを置かないので、セキュリティ事故を未然に防ぐ事ができる事ですね。

 

後、移動ユーザープロファイルと併用すれば、シンクラ端末さえあれば、どこでも業務ができますので、好きな場所で仕事ができ、様々なメリットがあります。

 

そして、仮想デスクトップは、Window10などのクライアントOSで構築するVDI、Windows Server 2016などで構築するSBC方式があります。コスト削減でよく利用されるのがSBC方式で、まとめてメンテナンスなどもできるので管理も楽だったりします。

 

その場合に、Windows、RDPのライセンスを全ユーザー分購入する事が難しい場合もあるかもしれません。その場合は、長時間ユーザーにデスクトップを占領させずに、一定時間、操作がない場合にログオフさせてリソースを有効活用したいという要望があるかもしれません。

 

 

そういった場合に便利なツールが「Idlelogoff.exe」です。

www.intelliadmin.com

 

上記サイトからフリーツールを入手することができます。使い方を分かりやすく説明してくれているブログがこちら。※英語です。

>>Force Logoff idle users with idlelogoff.exe

 

原文です。

You want to force logoff users that are idle on a PC (e.g., a Windows RD server).
Solution
Use Idlelogoff.exe!
First you will need to download the software from intelliadmin.
http://www.intelliadmin.com/index.php/downloads/
The software is called “idlelogoff”.
Once the program is downloaded you can easily script your custom logoff need. Here are some examples of how it can be used:
Here is how it works, you call the program like this:
idlelogoff.exe [timeout] [action]
timeout – The number of idle seconds before the action is taken
action - [logoff / lock / shutdown] You can lock the workstation, log the user off, or shutdown the workstation.

If you wanted a user to get booted off after 5 minutes (300 Seconds) of no activity, You would call it like this:
idlelogoff.exe 300 LOGOFF
If you wanted it to lock the workstation after 30 seconds of no activity this would do the trick
idlelogoff.exe 30 LOCK
If you wanted it to shutdown the workstation after 30 seconds of no activity this would do it:
idlelogoff.exe 30 SHUTDOWN
It has some sanity checking for the timeout. Anything less than 10 seconds is set to 10 seconds.
This can be scripted via batch or vbs.
I recently set it to autostart on user logon via the Startup folder. You could also do this using a GPO, but this is a simpler example.
Created shortcut of idlelogoff.exe
set target = c:idlelogoffidlelogoff.exe 14400 LOGOFF
placed shortcut in c:documents and settingsall usersstart menuprogramsstartup
This set an idle logoff time of 4 hours for ANYONE that logs into the machine. So if anyone is idle for that amount of time it logs them off automatically.

 

例えば、RDサーバーなどのWindows端末から自動的に、強制的にユーザーをログオフさせてい場合に使えるソフトです。


①まず、上述したURLからソフトウェアをダウンロードします。

 

②ソフトウェアの名前は、“idlelogoff”です。

 

②ソフトをダウンロードした後は、スクリプトをカスタマイズするだけで使えます。

【構文】
idlelogoff.exe [timeout] [action]

 

timeout – アクションが実行されるまでの、時間(秒)を指定します。
action - [logoff / lock / shutdown] timeoutで指定した時間の後、ログオフ、ロック、シャットダウンのいずれかを実行します。

 

If you wanted a user to get booted off after 5 minutes (300 Seconds) of no activity, You would call it like this:

例えば、300秒何の操作もない場合に、ユーザーにログオフさせる場合は、以下のように記述したスクリプトを作成します。


idlelogoff.exe 300 LOGOFF

 

30秒後にロックしたい場合は、以下のようにスクリプトを作成します。

idlelogoff.exe 30 LOCK

 

30秒後にシャットダウンさせたい場合は以下のように記述します。

idlelogoff.exe 30 SHUTDOWN


これは、バッチまたはVBSを経由してスクリプト化することができます。例えば、ADがいる環境であれば、GPOのログオンスクリプトに指定すれば、ユーザのログオン時に自動的に起動するように設定できます。

 

ちなみに、画像つきでさらに細かく説明してくれているサイトがこちら。

 

>>Automatically log off idle users in Windows - 4sysops

 

例えば、VMwareのHorizon Viewはアイドルタイムを判別してログオフなどをさせる機能がないので、とても便利なツールになります。