Platforms to show: All Mac Windows Linux Cross-Platform

WindowsWMIMBS class

Super class: WMIObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Windows MBS Win Plugin 7.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
A class to run queries in the Windows Management Interface.
Example
Var w as WindowsWMIMBS

w=new WindowsWMIMBS

if w.ConnectServer("root\cimv2") then
MsgBox "ConnectServer: ok"

if w.query("WQL","SELECT * FROM Win32_Processor") then
MsgBox "query: ok"

if w.NextItem then
MsgBox "NextItem: ok"

MsgBox w.GetPropertyString("Name") // string
MsgBox str(w.GetPropertyInteger("MaxClockSpeed")) // uint32
MsgBox str(w.GetPropertyInteger("ProcessorType")) // uint16

else
MsgBox "NextItem: fail"
end if
else
MsgBox "query: fail"
end if

else
MsgBox "ConnectServer: fail"
end if

In Windows 8.1 (or later) it looks like WindowsWMIMBS.InitSecurity(false) must be called at app.Constructor time as Xojo will do some things in background when opening first window which block our queries.
Subclass of the WMIObjectMBS class.

Authentication Level

Constant Value Description
kAuthenticationLevelCall 3 Authenticates only at the beginning of each remote procedure call when the server receives the request. Datagram transports use kAuthenticationLevelPaket instead.
kAuthenticationLevelConnect 2 Authenticates the credentials of the client only when the client establishes a relationship with the server. Datagram transports always use kAuthenticationLevelPacket instead.
kAuthenticationLevelDefault 0 Tells DCOM to choose the authentication level using its normal security blanket negotiation algorithm. For more information, see Security Blanket Negotiation.
kAuthenticationLevelNone 1 Performs no authentication.
kAuthenticationLevelPacket 4 Authenticates that all data received is from the expected client.
kAuthenticationLevelPacketIntegrity 5 Authenticates and verifies that none of the data transferred between client and server has been modified.
kAuthenticationLevelPacketPrivacy 6 Authenticates all previous levels and encrypts the argument value of each remote procedure call.

Impersonation Level Constants

Constant Value Description
kImpersonationLevelAnonymous 1 The client is anonymous to the server. The server process can impersonate the client, but the impersonation token will not contain any information and cannot be used.
kImpersonationLevelDefault 0 DCOM can choose the impersonation level using its normal security blanket negotiation algorithm. For more information, see Security Blanket Negotiation.
kImpersonationLevelDelegate 4 The server process can impersonate the client's security context while acting on behalf of the client. The server process can also make outgoing calls to other servers while acting on behalf of the client, using cloaking. The server may use the client's security context on other machines to access local and remote resources as the client. When impersonating at this level, the impersonation token can be passed across any number of computer boundaries.
kImpersonationLevelIdentity 2 The server can obtain the client's identity. The server can impersonate the client for ACL checking, but it cannot access system objects as the client.
kImpersonationLevelImpersonate 3 The server process can impersonate the client's security context while acting on behalf of the client. This level of impersonation can be used to access local resources such as files. When impersonating at this level, the impersonation token can only be passed across one machine boundary. The Schannel authentication service only supports this level of impersonation.

Super class WMIObjectMBS

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes

  • Version 24.3
    • Fixed an issue with using ConnectServer function in WindowsWMIMBS class in a thread.

The items on this page are in the following plugins: MBS Win Plugin.


WindowsVolumeInformationMBS   -   WinExceptionMBS


The biggest plugin in space...