Share via

WMI and BitLocker and VBScript

Bruce204 1 Reputation point
2021-03-14T18:45:48.333+00:00

Greetings.

Not sure if I am at the right place, perhaps someone can direct me to the correct forum.

I have experimented with WMI and VBScript. I can query WMI via VBScript on my local machine or a remote machine in the same domain. For example, I can instantiate the WMI service and I can execute a query such as "select * from Win32_BIOS" and retrieve the SerialNumber attribute from the Win32_BIOS class.

I also want to access the class Win32_EncryptableVolume but I am not successful with instantiating the WMI service for this class. I do not know if I am not doing it correctly or I do not have permission. I have admin rights on our domain so I do not think the problem is with my permissions.

The following VBScript works for me.

Set objWMIService = GetObject("winmgmts:\" & strComputer)

The following VBScript results in “Error 0x80041003 Code 80041003 Source (null)”.

Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption")

Is this a permissions problem or a scripting error?

Later I hope to convert my VBScript to PowerShell, but that will be for another day. If anyone has any suggestions please let me know. Thanks.

Developer technologies | Visual Basic for Applications
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.