Methods 使用VBScript解锁bitlocker驱动器
我正在尝试使用DRA证书编写bitlocker驱动器解锁脚本。我试图使用WMI方法UnlockWithCertificateFile,但我一辈子都搞不清楚我做错了什么,甚至找不到一个例子 我知道证书和pin有效,因为我可以使用manage-bde-unlock…手动解锁驱动器 当我运行我的脚本时,我得到一个返回值-2146885623,我查找到它是-2146885623,“找不到请求的对象” 我不知道它在说什么 这是我正在使用的代码(减去pin) 有没有人用过这种方法,或者有人看到我可能做错了什么?另外,我使用的是Windows8命令行恢复选项,我不确定这是否有什么不同,因为我已经测试过调用其他方法,wmi和脚本似乎已经完全实现Methods 使用VBScript解锁bitlocker驱动器,methods,vbscript,wmi,Methods,Vbscript,Wmi,我正在尝试使用DRA证书编写bitlocker驱动器解锁脚本。我试图使用WMI方法UnlockWithCertificateFile,但我一辈子都搞不清楚我做错了什么,甚至找不到一个例子 我知道证书和pin有效,因为我可以使用manage-bde-unlock…手动解锁驱动器 当我运行我的脚本时,我得到一个返回值-2146885623,我查找到它是-2146885623,“找不到请求的对象” 我不知道它在说什么 这是我正在使用的代码(减去pin) 有没有人用过这种方法,或者有人看到我可能做错了什
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{a2965903-4af0-11e2-be65-806e6f6e6963}\'")
' Obtain an InParameters object specific
' to the method.
Set objInParam = objShare.Methods_("UnlockWithCertificateFile"). _
inParameters.SpawnInstance_()
' Add the input parameters.
objInParam.Properties_.Item("PathWithFileName") = "D:\BitLocker.pfx"
objInParam.Properties_.Item("Pin") = "PinCode
' 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{a2965903-4af0-11e2-be65-806e6f6e6963}\'", "UnlockWithCertificateFile", objInParam)
' List OutParams
Wscript.Echo "Out Parameters: "
Wscript.echo "ReturnValue: " & objOutParams.ReturnValue