Disable Laptop After Set Date or Time Period


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.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Muhammad MullaSystems AdministratorCommented:
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 CSenior EngineerCommented:
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.
wyhelpofficerAuthor Commented:
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?
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

wyhelpofficerAuthor Commented:
ScottCha - I believe the DCs are 2012. Would this method work if the users are logging into the laptops off site using cached credentials?
Scott CSenior EngineerCommented:
Now that I think about it that way, probably not.  Unless they are on the network, the loaner wouldn't know that the account was disabled.

I'd give them a grace period of a couple of days and disable their network account.  

Have them sign an agreement saying they will bring the laptop back within 30 days with the understanding that their account will be disable if they don't bring it back on time or make arrangements if they are not able to bring it back.

I've found that if there is a signed agreement users tend to think about it a bit differently.
Muhammad MullaSystems AdministratorCommented:
As far as scheduled tasks go, the date should be a start date.

You could import the following code as an xml file into task scheduler, and edit as per your needs.

This runs the shutdown.exe -s -t 00 1 minute after system startup (to give you a chance to login and stop it, when you need to) starting midnight on 01/10/2015 .

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <Description>1 minute grace period after startup.</Description>
    <Principal id="Author">
  <Actions Context="Author">
      <Arguments>-s -t 00</Arguments>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wyhelpofficerAuthor Commented:
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.

Thanks again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.