Quantcast
Channel: Symantec Connect - Client Management Suite - Discussions
Viewing all articles
Browse latest Browse all 2021

Bitlocker Keys import

$
0
0
I need a solution

I am working on a script that will pull the bitlocker recovery key for a computer into Altiris.  The Script appears to get the information but it doesn't make it into Altiris.  The Guids for the custom data class are correct.  looking for ideas.  Script posted below.

 

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root/CIMv2/Security/MicrosoftVolumeEncryption")

Set objCIMObj = objWMIService.ExecQuery("select * from Win32_EncryptableVolume",,48)

dim nse
set nse = WScript.CreateObject ("Altiris.AeXNSEvent")

nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
nse.Priority = 1

dim objDCInstance
set objDCInstance = nse.AddDataClass ("{5ac8ce35-db50-44c2-86c4-84841fcedc94}")

dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
 
  For Each objItem in objCIMObj
 
Set oShell = WScript.CreateObject("WSCript.shell")
oShell.run"cmd /K manage-bde -protectors -get """ &objitem.driveletter& """ >C:\keys.txt", 0, True

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\keys.txt", ForReading)

Do Until objFile.AtEndOfStream
    strNextLine = objFile.ReadLine
    If Len(strNextLine) > 0 Then
        strLine = strNextLine
    End If

Loop

objFile.Close

Wscript.Echo strLine

 

dim objDataRow
set objDataRow = objDataClass.AddRow

objDataRow.SetField 0, objItem.DriveLetter
objDataRow.SetField 1, strLine
Next

nse.SendQueued


Viewing all articles
Browse latest Browse all 2021

Trending Articles