[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.
To use the script:
- Download and install AutoIt.
- Compile a 32 and 64 bit version of the script.
- 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
- 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>
- Update distribution points for your boot images.
- Add a ‘run command line’ task sequence action with the following command line:
Step 4…Profit! Hope you have a great day. 🙂