wmi

Get PC's Monitor Information Using .NET / WMI

ε祈祈猫儿з 提交于 2019-12-19 07:35:11
问题 Is there anyway using WMI/.Net to grab monitor information such as Manufacturer, Serial Number, Monitor Size etc.? Using a script is an option as well, or can I query the registry directly to get this information? SELECT * FROM Win32_DesktopMonitor doesn't really return any useful information for me in this case. 回答1: You may want to try this https://raw.githubusercontent.com/MaxAnderson95/Get-Monitor-Information/master/Get-Monitor.ps1 Cheers 回答2: Hey, I use this tool for a lot of my WMI work

Is WMI a good way to making a hardware fingerprint?

喜夏-厌秋 提交于 2019-12-19 04:36:19
问题 I want to make a c++ install deployed windows application that would check hardware fingerprint (to verify that the user will use the application only on his computer). After some net research I decided that WMI is my tool. I started with a simple MFC application and for start I wanted to print out the MotherBoard SerialNumber. And just at this point the whole thing crashed. I checked on XP and Win7 and this property is not returned. And this got me thinking - what if there are some classes

Access the Windows 7 Boot Configuration Data using C#

蓝咒 提交于 2019-12-19 04:23:24
问题 I need to be able to access the identifier GUID of the current running installation of Windows from the Boot Configuration Data Store using c#. It can be returned from the command line running: bcdedit /enum {current} /v The problem I have is that in c# if I try to directly run this command (even though the program is running as Administrator) I'm told that bcdedit does not exist. I'm using: ProcessStartInfo procStartInfo = new ProcessStartInfo("bcdedit.exe", "/enum {current} /v"); The other

WMI Process Watching uses too much CPU! Any better method?

萝らか妹 提交于 2019-12-19 04:14:33
问题 I need to watch when certain processes are started or stopped on a Windows machine. I'm currently tapped into the WMI system and querying it every 5 seconds, but this causes a CPU spike every 5 seconds because WMI is WMI. Is there a better way of doing this? I could just make a list of running processes and attach an Exited event to them through the System.Diagnostics Namespace, but there is no Event Handler for creation. 回答1: This is not exactly how you'd do it in the real world but should

Change users parental control settings using WMI in c#

China☆狼群 提交于 2019-12-19 03:43:16
问题 I am really new to WMI and COM. I want to change some parameters to user accounts parental controls and the only API availble is WMI. The WMI provider class to use is WpcUserSettings. I don't understand how to modify the parameters for each user. Do i have to create a ManagmentObject of this class per user or are they already instanciated for each user. If some one could give me an example code for one user it would really help. Thanx ! EDIT: Hi again. I used your example to get user account

Failed to retrieve object property in WMI (c++)

假如想象 提交于 2019-12-19 03:16:12
问题 I want to do something with WMI (receiving some event notification) so I start with simple example from MSDN website: Receiving Event Notifications Through WMI this program receives an event notification (process creation) through WMI, and calls the function EventSink::Indicate upon receiving the event. I used the same code in the link above (copy/past) with one change: in the class EventSink, the function HRESULT EventSink::Indicate(long lObjectCount, IWbemClassObject **apObjArray) I added

Get the Cpu usage of each process from wmi

冷暖自知 提交于 2019-12-19 02:28:25
问题 I found many sources to get the cpu usage of each process. in general there are many ways to get the cpu usage of process . percentprocessortime from win32_perfformatteddata_perfproc_process performancecounter class in system.diagnostics by manual calculation Process class (by process.getcurrentprocess().totalprocessortime;) as said in here. FirstWay: For the remote process monitoring(my scenario is remote monitoring), the percentprocessortime always shows value 0 to 100+. this 100+ happens

WMI Get All Monitors Not Returning All Monitors

扶醉桌前 提交于 2019-12-18 21:50:50
问题 I am using WMI Win32_MonitorDesktop to get all the monitors information on the system. However it only returns one. I have tried it on several computers, and they definitely have multiple monitors on them, connected and working. ManagementObjectSearcher monitorObjectSearch = new ManagementObjectSearcher("SELECT * FROM Win32_DesktopMonitor"); foreach (ManagementObject monitor in monitorObjectSearch.Get()) { Debug.WriteLine(monitor["Description"]); } Does anyone know why i'm only getting 1

How to call a method with output parameters in PowerShell?

假装没事ソ 提交于 2019-12-18 18:48:50
问题 I'm working on a script to get started in PowerShell. I'm trying to convert a working VBScript script that enumerates mapped network drives on a remote Windows computer. One of the tasks is to use remote WMI to read the registry and find the process owner of explorer.exe in order to determine who is logged in. This seems easy enough going by this guide. However, the WMI method I need to call is GetOwner() from Win32_Process, which requires two output parameters to store its return value. How

WMI The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

*爱你&永不变心* 提交于 2019-12-18 16:57:44
问题 My application requirement is like below. Application will run on domain admin system which will ping all machine under that domain, it will take disk drive, CPU and RAM details from all domain systems. Whenever I'm trying to ping machine I'm getting error that "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)" Code I'm using to connect remote machine is ConnectionOptions options = new ConnectionOptions(); options.EnablePrivileges = true; options.Impersonation =