Disable Laptop After Set Date or Time Period

Hi

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
wyhelpofficerAsked:
Who is Participating?
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 MullaCommented:
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.
2
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.
1
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?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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?
0
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.
1
Muhammad MullaCommented:
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">
  <RegistrationInfo>
    <Date>2015-09-17T13:56:41.3374967</Date>
    <Author>localpc\user</Author>
    <Description>1 minute grace period after startup.</Description>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <Repetition>
        <Interval>PT5M</Interval>
        <StopAtDurationEnd>false</StopAtDurationEnd>
      </Repetition>
      <StartBoundary>2015-10-01T00:00:00</StartBoundary>
      <Enabled>true</Enabled>
      <Delay>PT1M</Delay>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>localpc\Administrator</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\Windows\System32\shutdown.exe</Command>
      <Arguments>-s -t 00</Arguments>
    </Exec>
  </Actions>
</Task>

Open in new window

1

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.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.