8.x
Custom inventory can be used to detect the encryption status of each drive on a computer by querying WMI. The Custom Inventory script presented here was adapted from a forum discussion, Bitlocker Information from Altiris 7.x. In addition, this article presents a custom report that displays the custom inventory data and shows which computers and drives are encrypted. Please note that Symantec Support does not support custom scripting or reporting so modifications to the script and report must be made by the user.
On Error Resume Next
'Call WMI for encryption information
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume",,48)
Dim arEncryptionMethod
Dim arProtectionStatus
Dim arConversionStatus
Dim arLockStatus
arEncryptionMethod = Array("None", "AES 128 With Diffuser", "AES 256 With Diffuser", "AES 128", "AES 256")
arProtectionStatus = Array("Protection Off", "Protection On", "Protection Unknown")
arConversionStatus = Array("Fully Decrypted", "Fully Encrypted", "Encryption In Progress", "Decryption In Progress", "Encryption Paused", "Decryption Paused")
arLockStatus = Array("Unlocked", "Locked")
'=====================================================================
'Create instance of Altiris NSE component
dim nse
set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
' Set the header data of the NSE
' This GUID for the NS is the same for all versions of Altiris
nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
nse.Priority = 1
'myDataClass = "BitLocker_Status"
'If the above name doesn't work use the line below and replace the guid with
'the guid shown in the properties of the custom data class created on the server.
myDataClass = "{Copy the GUID in Step 1.h here, leave the curly brackets and quotes}"
'Create Inventory data block.
dim objDCInstance
set objDCInstance = nse.AddDataClass (myDataClass)
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
'Populate the NSE file with desired data
For Each objItem in colItems
'Add a new row for each drive on the computer
Dim objDataRow
set objDataRow = objDataClass.AddRow
Dim EncryptionMethod
Dim ProtectionStatus
Dim ConversionStatus
Dim EncryptionPercentage
Dim VolumeKeyProtectorID
Dim LockStatus
objItem.GetEncryptionMethod EncryptionMethod
objItem.GetProtectionStatus ProtectionStatus
objItem.GetConversionStatus ConversionStatus, EncryptionPercentage
objItem.GetKeyProtectors 0,VolumeKeyProtectorID
objItem.GetLockStatus LockStatus
objDataRow.SetField 0, objItem.DriveLetter
objDataRow.SetField 1, arEncryptionMethod(EncryptionMethod)
If arProtectionStatus(ProtectionStatus) = "Protection On" then
objDataRow.SetField 2, "1"
ElseIf arProtectionStatus(ProtectionStatus) = "Protection Off" then
objDataRow.SetField 2, "0"
End If
objDataRow.SetField 3, arConversionStatus(ConversionStatus)
objDataRow.SetField 4, arEncryptionPercentage(EncryptionPercentage)
objDataRow.SetField 5, arLockStatus(LockStatus)
Next
'send the NSE file
nse.Send
Figure 3. Custom report results show a 1 for each encrypted drive and a 0 for not-encrypted drives. If the drive shows 'NULL' then Bitlocker has not been installed on that computer and thus the WMI query returned no data. Also, the BIOS version is listed for each computer, which is collected separately by software inventory.