- 0
How can I determine if the drive is Encrypted (Protected) or not during a BitLocker task sequence in WinPE ?
Asked by
anyweb
Asked by
anyweb
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
you might need to know if your drive is Protected with Bitlocker or not while in WinPE, so how do you do that ? by utilising a call to the GetProtectionStatus Method of the Win32_EncryptableVolume Class
Using Wmi Code Creator I put together a simple code to check for the value of this class, so the first code looked like this
And i've made it a bit more friendly so that it returns a MSGbox telling us what the value was determined to be in the code below
Once you are happy with the results, copy this script to your Bitlocker sub folder of the MDT 2010 update 1 scripts directory, update the package to the dp's and create a new Run Command Line step in the task sequence called Check ProtectionStatus
This step sets a variable called DRIVE_Protected = True if an encrypted volume is found (if the return code is 1 or 2) and we can base other steps in the task sequence upon this variable (ie: in a REFRESH scenario).
The actual run command line is as follows cscript.exe "%scriptroot%\bitlocker\IsVolumeEncrypted.wsf"
Next, On the Options tab of this step, set the Success Codes to 0 1 2
Place this step before the Partition and Format disc steps in your task sequence. That's it, now you have enough info to query the computer in WinPE to find out if theres an encrypted volume or not,
and based upon this do different actions in the task sequence.
Remember to rem out the MSGbox command if you want this to run uninteruptted/zero touch
cheers
niall
Share this post
Link to post
Share on other sites