wmi

The Mono .NET framework and WMI

家住魔仙堡 提交于 2020-01-09 10:11:26
问题 We have a .NET project that uses WMI and are interested in porting it to the Mono framework. It appears Mono does not support WMI. Are there any libraries that can add WMI support? Basically we would want to access a Windows server using WMI from a Linux/OS X box. 回答1: Windows Management Instrumentation is a Microsoft implementation of WBEM (Web-Based Enterprise Management). There are open-source implementations (eg openPegasus) that you might be able to use a client, but there's no telling

The Mono .NET framework and WMI

浪子不回头ぞ 提交于 2020-01-09 10:11:11
问题 We have a .NET project that uses WMI and are interested in porting it to the Mono framework. It appears Mono does not support WMI. Are there any libraries that can add WMI support? Basically we would want to access a Windows server using WMI from a Linux/OS X box. 回答1: Windows Management Instrumentation is a Microsoft implementation of WBEM (Web-Based Enterprise Management). There are open-source implementations (eg openPegasus) that you might be able to use a client, but there's no telling

通过WMI实现远程创建共享目录,远程拷贝文件等操作

好久不见. 提交于 2020-01-08 01:23:11
通过WMI实现了远程创建共享目录,远程拷贝文件等操作: 代码下载 using System; using System.Collections.Generic; using System.Text; using System.Management; using System.IO; using System.Diagnostics; using System.Threading; using Log; using System.Windows.Forms; namespace BankSDS { /// <summary> /// 注册表主键枚举 /// </summary> public enum RootKey : uint { HKEY_CLASSES_ROOT = 0x80000000 , HKEY_CURRENT_USER = 0x80000001 , HKEY_LOCAL_MACHINE = 0x80000002 , HKEY_USERS = 0x80000003 , HKEY_CURRENT_CONFIG = 0x80000005 } /// <summary> /// 端机信息结构 /// </summary> public struct ServerInfo { public string ServerID; public string ServerSec;

powershell catch exception codes for wmi query

↘锁芯ラ 提交于 2020-01-07 09:04:31
问题 I am checking for services using WMI on a group of computers but with some I am getting errors. How do I capture these errors so I can take approptiate action? The query is $listOfServices = Get-WmiObject -credential $wsCred -ComputerName $comp.name -Query "Select name, state from win32_Service" If I get the following I want to try alternative credentials Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) If I get Get-WmiObject : User credentials cannot be

Windows 7 Action Center messages

孤人 提交于 2020-01-07 06:49:14
问题 I would like to know how to read, via vbscript, WMI, Powershell etc -the new Windows 7 Action center messages that the user normally gets informed of. I want to read all those messages on each machine and store then in a central database, then disable the messages from displaying to the user on the local machines. My questions are - 1. Where are these messages stored on the local Win7 systems and 2 -How do i programatically read those messages. 回答1: This post suggests that it may not be

TotalPhysicalMemory from VisualBasic.Devices slightly different from WMI Win32_PhysicalMemory

雨燕双飞 提交于 2020-01-06 17:56:26
问题 So my application requires knowing total RAM available. At least 4 different ways exist, as far as I'm concerned: Query Windows Menagement Instrumentation (WMI) Get it from Microsoft.VisualBasic.Devices.ComputerInfo.TotalPhysicalMemory Query WinAPI Use P-Invoke I like the first two, hovewer they give slightly different results on my machine (2 sticks of 2GB each, Windows 8.1 64 bit). The code I use to get it from VisualBasic dll: class Program { private static readonly Lazy<ComputerInfo>

How can I query teminal services activity remotely?

六月ゝ 毕业季﹏ 提交于 2020-01-06 05:41:10
问题 I want to query our servers to see look for disconnected/idle sessions. I know I can use 'query.exe', but I'd prefer something that's easier to work with from code. WMI would be my preference. Thanks. 回答1: If you are using a .NET language, you might try Cassia. In C#, the code would be: using System; using Cassia; namespace CassiaSample { public static class Program { public static void Main(string[] args) { ITerminalServicesManager manager = new TerminalServicesManager(); using

How can I query teminal services activity remotely?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 05:41:05
问题 I want to query our servers to see look for disconnected/idle sessions. I know I can use 'query.exe', but I'd prefer something that's easier to work with from code. WMI would be my preference. Thanks. 回答1: If you are using a .NET language, you might try Cassia. In C#, the code would be: using System; using Cassia; namespace CassiaSample { public static class Program { public static void Main(string[] args) { ITerminalServicesManager manager = new TerminalServicesManager(); using

Remote WMI call to BizTalk object throws COMException (0x80131904)

时间秒杀一切 提交于 2020-01-06 04:33:10
问题 I'm trying to run an WQL query(SELECT * FROM MSBTS_SendPort) on an BizTalk host but when I run this query in my console application on an remote primary BizTalkHost I get an COMException who says "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." If I run the same console application on the primary BizTalkHost then everything works. 回答1: I'm issueing an double-hop authentication issue, so therefore what I want will never work. See this link for more information. My workaround for this

Why does ManagementObjectSearcher.Get() throw an UnauthorizedAccessException?

♀尐吖头ヾ 提交于 2020-01-06 04:04:32
问题 I am developing a .Net 4.6.1 desktop application that is using the following code to determine the human-friendly OS name for logging purposes (as suggested in this answer). public static string GetOSFriendlyName() { string result = string.Empty; ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem"); foreach (ManagementObject os in searcher.Get()) { result = os["Caption"].ToString(); break; } return result; } However, I'm getting error