Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/systemjargon/windows-logoff-hours

For Windows OS. Force logout and restrict the logon hours allowed by defined hours. Times/users set as variables in powershell script. Useful for parents.
https://github.com/systemjargon/windows-logoff-hours

logon-hours parental-control parental-control-tool powershell powershell-script

Last synced: 17 days ago
JSON representation

For Windows OS. Force logout and restrict the logon hours allowed by defined hours. Times/users set as variables in powershell script. Useful for parents.

Awesome Lists containing this project

README

        

I have a powershell script which does most of the command line and scheduled task work for you.
It it commented to self-explain what it does mostly.

Filename: set-logoff-time.ps1

* [View in GitHub](https://github.com/SystemJargon/windows-logoff-hours/blob/main/set-logoff-time.ps1)
* [RAW PS1 file / download](https://raw.githubusercontent.com/SystemJargon/windows-logoff-hours/main/set-logoff-time.ps1)

----

Otherwise use the guide below / copy and paste the command line examples given, again change username/time to suit your requirements.

## How-To

Open the commaand prompt as Administrator, powershell can work but may not recognize multi-string days using ";".

Replace username "kids" with whatever username is desired.

Day format is, Su, M, T, W, Th, F, Sa

uses 12 hour clock, not 24 hour clock.

## EXAMPLES ##

### To add all days of the Week and allow only login between 10am to 10pm.
net user kids /time:M-Su,10am-10pm

### To remove any logon hours
net user kids /time:ALL

### To restrict ALL logon hours (none allowed)
net user kids /time:

### Multiple days string with limits (or use just single days if wanted)
net user kids /time:Sa-Su,8am-9pm;M-F,4pm-9pm

### Force logoff when time is up
Scheduled task, set a time. Action: Program, "shutdown", Parameters/Arguments: "/l /f" (no quote marks).