Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

WindowsWMIMBS class

Super class: WMIObjectMBS

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Windows MBS Win Plugin 7.4 No Yes No Yes, Windows only No
Function: A class to run queries in the Windows Management Interface.
Example:
dim 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
Notes:
In Windows 8.1 it looks like WindowsWMIMBS.InitSecurity(false) must be called at app.open time as Xojo will do some things in background when opening first window which block our queries.
Subclass of the WMIObjectMBS class.

Feedback, Comments & Corrections

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 which use this class:


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


WindowsVolumeInformationMBS   -   WinExceptionMBS




Links
MBS Xojo Plugins