Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/systemjargon/windows-logoff-hours
- Owner: SystemJargon
- License: mit
- Created: 2021-11-20T01:20:00.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-18T05:26:11.000Z (almost 2 years ago)
- Last Synced: 2024-11-13T02:17:41.258Z (3 months ago)
- Topics: logon-hours, parental-control, parental-control-tool, powershell, powershell-script
- Language: PowerShell
- Homepage:
- Size: 64.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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).