Tag: wmi

C#

Get Windows Users with C# and WMI

class SystemUser { public enum AccountType { DUPLICATE_ACCOUNT = 256, NORMAL_ACCOUNT = 512, INTERDOMAIN_TRUST_ACCOUNT = 2048, WORKSTATION_TRUST_ACCOUNT = 4096, SERVER_TRUST_ACCOUNT = 8192 };   public AccountType Type { get; set; } public string Caption { get; set; } public string Description { get; set; } public bool Disabled { get; set; } public string Domain …

C

Get installed firewall in C

You will need to include the libraries ole32.lib, oleaut32.lib and wbemuuid.lib into your project. The following code can be compiled in Code::Blocks and Eclipse, no need for Visual Studio. Includes and Definitions: #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <stdbool.h> #include <wbemidl.h>   #define WIN_VISTA 0x0600   CLSID CLSID_WbemLocator2 = {0x4590F811, 0x1D3A, 0x11D0, {0x89, 0x1F, …

C

Get installed antivirus in C

You will need to include the libraries ole32.lib, oleaut32.lib and wbemuuid.lib into your project. The following code can be compiled in Code::Blocks and Eclipse, no need for Visual Studio. Includes and Definitions: #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <stdbool.h> #include <wbemidl.h>   #define WIN_VISTA 0x0600   CLSID CLSID_WbemLocator2 = {0x4590F811, 0x1D3A, 0x11D0, {0x89, 0x1F, …

C

Getting information from WMI in C

You will need to include the libraries ole32.lib, oleaut32.lib and wbemuuid.lib into your project. The following code can be compiled in Code::Blocks and Eclipse, no need for Visual Studio. Includes and Definitions: #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <stdbool.h> #include <wbemidl.h>   #define WIN_VISTA 0x0600   CLSID CLSID_WbemLocator2 = {0x4590F811, 0x1D3A, 0x11D0, {0x89, 0x1F, …

Information, Microsoft Windows, Programming, Windows Internals

Browse and query WMI

Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems. You can write WMI scripts or applications to automate administrative tasks on remote computers but WMI also supplies management data to other parts of the operating system and products, for example System Center Operations Manager, formerly Microsoft Operations Manager …

Microsoft SQL Server, Microsoft Windows

How do I fix “Cannot connect to WMI Provider” error?

Error Message: Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 servers with SQL Server Configuration Manager. Invalid Namespace. This error is caused when the .mof files are damaged during the MS SQL Server 2005 installation. This error typically occurs …