6 Replies Latest reply on Jan 17, 2011 10:14 AM by DanDinolfo

    Task Triggered by going on AC Power.

    Spartan Apprentice

      Good Day,


      I was wondering if anybody knew of a way to Trigger a command when a laptop get's connected to a power source?


      Here is my scenario.


      We have users on Netbooks that get stored in a cart when not in use (End users do not have AC adapters for them).

      Due to the limited resources on these machines we like to run as little as possible while in use (when running on DC power).


      When the user is done with the machine they are instructed to log out and return the machine to the cart where it is left charging in an powered on state.


      Ideally plugging the machine would trigger a script that would run the following "maintenance" script and shutdown


      LDISCN32.exe /SYNC /ntt=superhappyfuncore:5007 /s=superhappyfuncore /I=HTTP://superhappyfuncore/ldlogon/ldappl3.ldz


      vulscan.exe /showui

      poweroff.exe 120


      We currently have something like this running after hours but this often leaves the machine running for unnecessarily.


      Also wondering if their is a way to tell the script when the policy(s) (if any) have completed?


      NOTE: We are running LDMS 9 SP2 and the machines are running Windows 7 Pro 32bit.

      Currently playing around with Windows Task Scheduler setting the tasks to run when the system is idle and plugged in but it's not running as expected.

      I'm guessing background tasks are preventing the machine from being "idle" so it's not working well.



      Thank you,

        • 1. Re: Task Triggered by going on AC Power.

          If it was me, I'd try using power policy.  You could easily set a power policy to shut the computers down after X minutes when on AC.  Yes, I know that doesn't solve your running a program issue, but if you set that power policy to turn all of the laptops on at say...3am, and then run your scripts, and then shut them back down, you could get your desired effect.

          1 of 1 people found this helpful
          • 2. Re: Task Triggered by going on AC Power.
            Spartan Apprentice

            Good Morning,


            Thanks for the advice, but I'm not sure I can get these machine to Wake on Wireless LAN (as they are low end machines) =o(

            If I understand correctly Power Management uses WOL exclusively to turn machines back on (even if in sleep)?


            I guess I could use the Windows scheduler (or some other 3rd party application) to wake these up if I was to put them to sleep rather than shutdown.

            • 3. Re: Task Triggered by going on AC Power.

              There are two ways to wake up computers.  If you use the checkbox "Enable Local Wakeup" the systems will wake themselves up (assuming they are ACPI compliant).  I've tested it on systems, and they would wake up even with out a network connection.  I normally recommend STRONGLY against using that option on laptops, since it has the potential to wake up a laptop when it shouldn't be woken up (think inside of a laptop bag while in your trunk, airplane, etc.).  At the very least using up extra battery, or at the worst, overheating the system since it's in a bag.  But since these computers would be in a well ventilated area, that shouldn't be a problem.  If you don't use that checkbox, the systems will just use WOL.  If you do check the box, it will use both WOL and Local Wakeup.

              • 4. Re: Task Triggered by going on AC Power.

                I only tested it with Standby.  For my purposes, I don't ever see myself taking computers 100% down.  Standby only uses 1-2 watts.  It's not worth the time difference.

                • 5. Re: Task Triggered by going on AC Power.
                  Spartan Apprentice

                  Wow, I guess I get to go to bed a little smarter tonight =o)

                  Didn't even notice the local wake up option.


                  Thank you good Sir,


                  I think I will follow your advice.

                  • 6. Re: Task Triggered by going on AC Power.

                    I believe it was one of the new features of SP2.  Very handy.  We have a training pool of laptops that are locked away in a closet.  We're planning on doing something similar.