DRIVE EFFICIENCY THROUGH AUTOMATED IT.
SAVE COST THROUGH CONSOLIDATION OF IT.
WANT TO KNOW MORE ABOUT STRATEGIC CONSULTING CLICK HERE.
MICROSOFT / RISUAL HYPER-V CLOUD EVENT 22ND MARCH 2011 CLICKHERE.
Home > Uncategorized > Diskpart during an OSD Task Sequence

Diskpart during an OSD Task Sequence

Whilst at a customer recently I had a requirement to run a ‘Diskpart /Clean’ at the start of a task sequence to remove any encryption on the drive, in this case McAfee. I have done this several times in the past however always hit a few niggles so thought I would blog to refer to in the future :)

The easiest way to do this is to perform the following;

  1. Mount your Windows PE image(s) to a directory
  2. Create a text file called ‘CleanPartitions.txt’ (for arguments sake), with the following content;
    • Select Disk 0
    • Clean
  3. Copy this text file to ‘<Mounted Folder>\Windows\System32′ (again, for arguments sake)
  4. Commit the mounted folder back to the .WIM

In your task sequence, before the standard ‘Format and Partition Disk’ phase, perform the following;

  1. Add a ‘Run Command Line’ task
  2. In the ‘Command Line:’ text area, type;
    • diskpart.exe /s “%windir%\system32\CleanPartitions.txt”
  3. Disable 64-bit file redirection
  4. Save the task sequence

This should now run successfully and remove any encryption on the drive :)

It is worth noting that this will only work in a Lite-touch situation as you will need to either PXE-boot or use bootable media. There is a solution that McAfee have released that allows you to perform this end-to-end in a Zero-Touch situation that I will blog about soon.

Cheers

SteveH

  1. Lee
    April 2nd, 2012 at 17:06 | #1

    Any updates on McAfee suggested solution? I tried it but its not playing nice so far.

  2. steveh
    April 4th, 2012 at 09:15 | #2

    Unfortunately not. McAfee do have a document available which I was working from earlier this year but the solution is very convoluted and at the time did not seem worthwhile as we were only looking at a couple of hundred laptops that would not be rebuilt that regulary in any case.

    The document can be found here;

    https://kc.mcafee.com/resources/sites/MCAFEE/content/live/PRODUCT_DOCUMENTATION/23000/PD23237/en_US/McAfeeEE5x_WindowsOSRefres_v1_1.pdf

    The key issue I had was Appendix C and coming up with a solution to stage the WinPE image whilst suppressing the reboot so that I could reset the MBR to McAfee’s EPR. In SCCM Zero-Touch the ‘Reboot’ task sequence step incorporates the staging and reboot process and without developing your own script it is difficult to separate.

    Be interested to hear if you have any success with this, good luck :)

    Thanks,

  1. No trackbacks yet.