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;
- Mount your Windows PE image(s) to a directory
- Create a text file called ‘CleanPartitions.txt’ (for arguments sake), with the following content;
- Select Disk 0
- Clean
- Copy this text file to ‘<Mounted Folder>WindowsSystem32′ (again, for arguments sake)
- Commit the mounted folder back to the .WIM
In your task sequence, before the standard ‘Format and Partition Disk’ phase, perform the following;
- Add a ‘Run Command Line’ task
- In the ‘Command Line:’ text area, type;
- diskpart.exe /s “%windir%system32CleanPartitions.txt”
- Disable 64-bit file redirection
- 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


