Answer the question
In order to leave comments, you need to log in
How to turn off the computer when inactive for a certain time?
I never managed to set up sleep on several computers.
They do not fall asleep and at least what you do.
Actually, then the idea arose to simply turn them off when idle, for example, 2 hours.
How to do it better?
Write a script - the first thing that comes to mind, but how to determine the PC idle time?
Are there any other ways or ideas?
Answer the question
In order to leave comments, you need to log in
I recently learned (about 8 months ago) that in PowerShell you can use C # directly in a script.
Add-Type @'
public class Foo
{
public string GetComputerName()
{
return System.Environment.MachineName + " it works!";
}
}
'@
$foo = New-Object Foo
$foo.GetComputerName()
To begin with, answer yourself the question: how will you determine the inactivity of the computer?
If your computers do not go to sleep according to the standard scheme, then there is a suspicion that there is no inactivity, in fact, or some program, service or device is preventing the computer from going to sleep.
Solve these problems - and do not have to collective farm.
Although, of course, you can come up with a "cunning" scheme like: press the pop-up button once every 15 minutes, otherwise the computer will explode and go to sleep.
Then the script will help, yes.
The most logical option. Through the task scheduler. We launch a batch file with a larger timer - 1.bat
Suddenly, the user is still at the workplace.
shutdown -s -t 600 -c "The computer will turn off in 10 minutes"
If the user is still in place, then create a batch file for him on the desktop 2.bat
shutdown -a
It will work if the user has admin rights.
If the user has rights - Users, then the session will only end. Conclusion - in the scheduler we prescribe - run on behalf of the Administrator. Specify - regardless of user registration.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question