Solved

WMI Query for BitLocker status on C drive in Task Sequence in SCCM

Posted on 2013-06-24
2
3,487 Views
Last Modified: 2013-07-02
I need to put a bit of logic in my task sequence that will only deploy a package if the C drive is not encrypted (there are two volumes on our machines)

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2\Security\MicrosoftVolumeEncryption") 
' Obtain an instance of the the class 
' using a key property value.
Set objShare = objWMIService.Get("Win32_EncryptableVolume.DeviceID='\\?\Volume{1e2a7781-dd0f-11e2-90bf-24be05232bd4}\'")

' no InParameters to define

' Execute the method and obtain the return status.
' The OutParameters object in objOutParams
' is created by the provider.
Set objOutParams = objWMIService.ExecMethod("Win32_EncryptableVolume.DeviceID='\\?\Volume{1e2a7781-dd0f-11e2-90bf-24be05232bd4}\'", "GetLockStatus")

' List OutParams
Wscript.Echo "Out Parameters: "
Wscript.echo "LockStatus: " & objOutParams.LockStatus
Wscript.echo "ReturnValue: " & objOutParams.ReturnValue

Open in new window


How do I get to the point of identifying the C drive as the volumes are shown as security identifiers?

Can anyone assist?
0
Comment
Question by:aideb
2 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 39273843
Powershell
$BitLockDrive = get-wmiobject -ComputerName "." -namespace root\CIMv2\Security\MicrosoftVolumeEncryption `
        -class Win32_EncryptableVolume `
        | select DriveLetter, IsVolumeInitializedforProtection
foreach( $drive in $BitLockDrive) {
#$Write-Output ($drive.DriveLetter)
If (($drive.DriveLetter -eq "C:" ) -and ($drive.IsVolumeInitializedforProtection -like "False") )
    {
   # This Drive is Not Encrypted
    $drive.DriveLetter
    $drive.IsVolumeInitializedForProtection
    }
}
     

Open in new window

0
 
LVL 2

Author Closing Comment

by:aideb
ID: 39294777
Thanks for a great solution!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question