SCCM – Check for Laptop Power and Battery Status Before Imaging

[Update] It helps if I add a download link! The script can be had from my Github repo here: John Puskar’s Github Repo.


Our task sequences have some Dell CCTK integration, which fails if the battery is below a certain percentage or if the AC adapter isn’t connected. The following AutoIT script will pop-up a box prompting that the AC adapter be connected. Once connected, the popup shows the battery’s charge with a progress window. Once the battery hits 60%, the task sequence continues.

Screenshots!

power-1
power-2

Instructions

To use the script:

  1. Download and install AutoIt.
  2. Compile a 32 and 64 bit version of the script.
  3. Add the compiled EXE files to the following respective folders on your SCCM site server:
    C:\Program Files\Microsoft Configuration Manager\OSD\Extras\Power32
    C:\Program Files\Microsoft Configuration Manager\OSD\Extras\Power64
  4. Modify the following file on your site server:
    C:\Program Files\Microsoft Configuration Manager\bin\X64\osdinjection.xml

    Add the following lines in the respective sections:

    --to the i386\SCCM section:
    <File name="waitforbattery.exe">
    	<LocaleNeeded>false</LocaleNeeded>
    	<Source>extra\power32</Source>
    	<Destination>windows\system32</Destination>
    </File>
    
    --to the x64\SCCM section:
    <File name="waitforbattery.exe">
    	<LocaleNeeded>false</LocaleNeeded>
    	<Source>extra\power64</Source>
    	<Destination>windows\system32</Destination>
    </File>
    
  5. Update distribution points for your boot images.
  6. Add a ‘run command line’ task sequence action with the following command line:
    X:\windows\system32\waitforbattery.exe

Step 4…Profit! Hope you have a great day. 🙂

Advertisements

3 thoughts on “SCCM – Check for Laptop Power and Battery Status Before Imaging

  1. Pingback: Table of Contents | windowsmasher

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s