![]() ![]() Set IWbemServices proxy security so the WMI service can impersonate the client by calling CoSetProxyBlanket.įor more information, see Setting the Security Levels on a WMI Connection. To connect to a remote computer, see Example: Getting WMI Data from a Remote Computer. ![]() Obtain a pointer to IWbemServices for the root\cimv2 namespace on the local computer by calling IWbemLocator::ConnectServer. Obtain the initial locator to WMI by calling CoCreateInstance.įor more information, see Creating a Connection to a WMI Namespace. Initialize COM process security by calling CoInitializeSecurity.įor more information, see Setting the Default Process Security Level Using C++. Initialize COM parameters with a call to CoInitializeEx.įor more information, see Initializing COM for a WMI Application. Steps 1 through 5 contain all the steps required to set up and connect to WMI, and steps 6 and 7 are where data is queried and received. The following procedure is used to execute the WMI application. For getting the data asynchronously, see Example: Getting WMI Data from the Local Computer Asynchronously. To retrieve data from a remote computer, see Example: Getting WMI Data from a Remote Computer. This example gets the name of the operating system on the local computer and displays it. You can use the procedure and code examples in this topic to create a complete WMI client application that performs COM initialization, connects to WMI on the local computer, retrieves data semisynchronously, and then cleans up. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |