I'm trying to manage a pool of Windows 7 loan laptops that are intended for our users to borrow short term. We are having a hard time persuading people to bring them back, which means we never have any available when people need them.
So, I would like to try and find a way to loan out a machine for say 30 days, and somehow disable the computer after that amount of time.
Users do log in using their AD credentials so I don't want to disable their accounts because they will still need to log in to their desktop PCs at the office.
I can't see any built-in way of doing this, is anybody aware of any third party software that could do this for us? One thing I did think of is to write a script that runs on startup, checks the date and runs a shutdown command if a certain date is exceeded - would this potentially work and if so could anyone help with the script???
Of course any other ideas would be appreciated.
Thanks
Windows OS
Last Comment
wyhelpofficer
8/22/2022 - Mon
Muhammad Mulla
set a scheduled task to run shutdown.exe -f -t 00 with the trigger set to the date that is after 30 days and repeat the task every 5 minutes. Set it to run as a particular user, whether or not the user is logged in.
This will, however, require some admin to change the start date of the trigger.
Scott C
What version of Windows Server are you running?
If it's 2012 you can use the Disable-ADAccount -identity <machine name> command.
Unfortunately this command is not available in Server 2008.
wyhelpofficer
ASKER
Scheduled task is an idea. But how would I set the trigger to the date.. the only options I see are to either trigger on a schedule, choose "one time" and then set the date. Or, trigger at startup and set the activation date accordingly.
The settings for both of these options suggest that the task would only run on the specified date, unless I have misunderstood that. Would either of these options cause the task to run even after the user restarted and logged in again the day after?
Thanks, well this gives me a couple of options. I'll test out the task and see how well that works, and if that doesn't work I'll have to think about disabling accounts.
This will, however, require some admin to change the start date of the trigger.