wmi

how to retrieve memory type ( rdimm or udimm)?

做~自己de王妃 提交于 2019-12-31 01:54:06
问题 is there a way to know if installed memory is Registered DIMM or Unregistered DIMM ? the win32_physicalMemory doesn't seem to provide this info ? you can find more info about udimm rdimm here EDIT : the solution provided by @C.B doesnt work either 回答1: The first idea is using WMI Win32_PhysicalMemory and test if TotalWidth (bit count including check bits) is greater than DataWidth (bit count excluding check bits). gwmi Win32_PhysicalMemory | select totalwidth, datawidth, banklabel | % { if (

Find application using port

寵の児 提交于 2019-12-30 10:25:52
问题 I have a networking program setup that does a lot of what the nestat program does. I am working now on netstat -o. That command will give me the PID of the program using that socket. I have some idea of where to look. I have been trying to use WMI to get that information but so far I have not found a suitable class. How can I find the PID or application name that is using a particular socket? I am using c# 回答1: AFAIK, this information is not exposed anywhere in the BCL or WMI. You'll need to

Pass Credentials to WMI Call in VBScript

帅比萌擦擦* 提交于 2019-12-30 09:04:27
问题 I have VBScript inside a HTA getting the ping status from a local WMI call.. I also have a function to get the last reboot time of the remote pc.. Function GetReboot(strComputer) Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOS in colOperatingSystems dtmBootup = objOS.LastBootUpTime dtmLastBootupTime = WMIDateStringToDate(dtmBootup) dtmSystemUptime = DateDiff

Motherboard ID - WMI C++ - Reliable?

老子叫甜甜 提交于 2019-12-30 07:43:11
问题 I'm using WMI in C++ classes to retrieve the serial number of my motherboard. The query is the following : "SELECT SerialNumber FROM Win32_BaseBoard" I wrote the query myself so i'm not certain it is correct, but it does return something : /9637CW1/CN1296131Q0BA8/ . The returned string is in the same format on multiple computers so i assume the query is correct. My question is : am i really querying the motherboard serial number here ? Because i saw another class called "Win32

Finding USB serial ports from a .NET application under Windows 7

家住魔仙堡 提交于 2019-12-30 05:01:08
问题 I have an application that looks for a specific FTDI serial port with customised USB descriptors. My current code uses the example from Code Project, which searches the MSSerial_PortName WMI table under root\WMI , and pulls out extra USB information from root\CIMV2\WIN32_PnPEntity . This worked well under XP, but the application must also run under a standard user onWindows 7. In this environment access of root\WMI results in an "Access Denied" ManagementException . Can anybody suggest a way

Where can I find the WMI documentation?

蓝咒 提交于 2019-12-30 03:32:05
问题 Google let me down, I couldn't find it on MSDN. man wmi doesn't work at the windows shell... I'm looking for a list of objects that I can query, and how to construct the queries. With WMI I mean the query language to query stuff like "Win32_Process" I know about the classes and example queries, but I'm looking for a complete list of all possible query objects. I already found what I'm looking for using the debugger, but it's still interesting to look at a complete overview to see what's

Check for Third Party Firewalls on a Machine

不羁的心 提交于 2019-12-30 01:16:07
问题 I am working on doing a check for Firewalls. The following code quite easily checks the status of the default Windows Firewall: INetFwMgr manager = GetFireWallManager(); bool isFirewallEnabled = manager.LocalPolicy.CurrentProfile.FirewallEnabled; if (isFirewallEnabled == false) { Console.WriteLine("Firewall is not enabled."); } else { Consoe.WriteLine("Firewall is enabled."); } Console.ReadLine(); private static INetFwMgr GetFireWallManager() { Type objectType = Type.GetTypeFromCLSID(new Guid

What Windows Class to use when I want to start a process remotely

回眸只為那壹抹淺笑 提交于 2019-12-29 08:23:14
问题 I want to use c# and WMI to start a process remotely in another computer. I've made some initial research and found out that i ultimately have to use a processclass. The "Win32_Process" was the first thing that seemed obvious to be used, however, it seems it is limited to represent only local processes. What other Windows process classes can I use? Here is what the code when using Win32_ScheduledJob class: static public String RemoteConnect() { try { ConnectionOptions conn = new

How to consume WMI Events in C#

蓝咒 提交于 2019-12-29 04:24:30
问题 There are some events expose via WMI, but I can't seem to find any examples for subscribing and being alerted of those events. Particularly I am wanting to implement WmiMonitorBrightnessEvent to push a notification to Growl/Snarl. 回答1: This is a sample code for receive the WmiMonitorBrightnessEvent WMI Event. using System; using System.Collections.Generic; using System.Management; using System.Text; namespace GetWMI_Info { public class EventWatcherAsync { private void WmiEventHandler(object

How to check the machine type? laptop or desktop?

泄露秘密 提交于 2019-12-28 05:53:07
问题 How to check current machine type? laptop or desktop ? I got this from http://blog.csdn.net/antimatterworld/archive/2007/11/11/1878710.aspx ,it works well on my home machine(Win2003 on laptop), it returns "Portable", but failed on my work machine(Vista on laptop), it returns "Other". here is the code: public enum ChassisTypes { Other = 1, Unknown, Desktop, LowProfileDesktop, PizzaBox, MiniTower, Tower, Portable, Laptop, Notebook, Handheld, DockingStation, AllInOne, SubNotebook, SpaceSaving,