wmi

Restart App Pool from ASP.NET via WMI Problems

坚强是说给别人听的谎言 提交于 2020-02-22 06:11:47
问题 I've been trying to create a C# ASP.NET page which sits on a Windows Server 2003 IIS 6 server and when called (remotely), restarts/recycles a specific application pool on the server. I've not been having much luck, does anyone know where I'm going wrong? I've tried many combinations and tried running direct from server but to no-avail. When I don't pass the credentials over I get the error... Access is denied ...and when I do pass them I get the error... User credentials cannot be used for

Restart App Pool from ASP.NET via WMI Problems

旧时模样 提交于 2020-02-22 06:04:29
问题 I've been trying to create a C# ASP.NET page which sits on a Windows Server 2003 IIS 6 server and when called (remotely), restarts/recycles a specific application pool on the server. I've not been having much luck, does anyone know where I'm going wrong? I've tried many combinations and tried running direct from server but to no-avail. When I don't pass the credentials over I get the error... Access is denied ...and when I do pass them I get the error... User credentials cannot be used for

How to I access the data of a WMI Query (via JNA) SAFEARRAY result

五迷三道 提交于 2020-02-05 05:39:07
问题 I use jna to run WMI queries. The following code queries WMI SELECT Caption,Capabilities from Win32_DiskDrive . The Type of Win32_DiskDrive.Capabilities is uint16[] and result.getValue returns a SAFEARRAY Instance. System.out.println("Var Type(3 expected): " + value.getVarType().intValue()); returns randomly 0 or 3 if I start the process several times. System.out.println("Size (>0 expected): " + (value.getUBound(0) - value.getLBound(0))); is correct, but Object el = value.getElement(0); fails

使用Python玩转WMI

回眸只為那壹抹淺笑 提交于 2020-01-31 06:01:44
  最近在网上搜索Python和WMI相关资料时,发现大部分文章都千篇一律,并且基本上只说了很基础的使用,并未深入说明如何使用WMI。本文打算更进一步,让我们使用Python玩转WMI。 1 什么是WMI   具体请看微软官网对 WMI的介绍 。这里简单说明下,WMI的全称是Windows Management Instrumentation,即Windows管理规范。它是Windows操作系统上管理数据和操作的基础设施。我们可以使用WMI脚本或者应用自动化管理任务等。   从 Using WMI 可以知道WMI支持如下语言: Application language Topic Scripts written in Microsoft ActiveX script hosting, including Visual Basic Scripting Edition (VBScript) and Perl Scripting API for WMI . Start with Creating a WMI Script . For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository. Windows

PowerShell操作WMI概览

爷,独闯天下 提交于 2020-01-28 20:17:19
什么是WMI WMI可以从计算机中收集大量系统信息。但有时候这些信息不易看懂,另外文档也不够友好。WMI是一个外部技术,PowerShell仅仅与其接口进行交互而已。 在最顶层,WMI被组织成命名空间(namespaces)。可以把命名空间想象为关联到特定产品或技术的一个文件夹。比如,“root\CIMv2”,该命名空间包含了所有Windows操作系统和计算机硬件信息。而“root\MicrosoftDNS”命名空间包含了所有关于DNS服务器(假设你已经在计算机中安装了该角色)的信息。 在命名空间中,WMI被分成一系列的类,每个类都是可用于WMI查询的管理单元。比如,在“root\SecurityCenter”中的“Antivirus-Product”类被设计用于保存反间谍软件的信息;在“root\CIMv2”中的“Win32_LogicalDisk”类被设计用于保存逻辑磁盘的信息。但是即使一个计算机上存在某个类,也不代表计算机实际上安装了对应组件。比如无论是否安装了磁带驱动程序。“Win32_TapeDrive”类在所有的Windows版本上都存在。不是所有的计算机都包含相同的WMI命名空间或类。 WMI的未来 在WMI大部分生命周期中,微软都没有把过多的精力放在对其内部控制上(最近有所好转)。微软为WMI制定了一系列的编程标准

MSVM_ComputerSystem WMI class returns only Hyper-V host

我的未来我决定 提交于 2020-01-24 18:00:47
问题 Having a problem in listing list of virtual machine from Hyper-V host (Windows 2012 R2) using WMI query remotely. (select * from MSVM_Computersytem). The query lists only Host system and no virtual machines are listed. WMI query is ran in the context of domain user from a remote system and has all required permission to Hyper-V host’s WMI name space (\root\Virtualization\V2). There is no error in connecting to Virtulization\V2 name space. I don’t see any WMI events in event logger as well.

How to get currently connected wifi SSID in c# using WMI or System.Net.NetworkInformation windows 10?

偶尔善良 提交于 2020-01-24 17:00:28
问题 I have tried in 2 different ways First way: null exception issue try{ ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSNdis_80211_ServiceSetIdentifier"); foreach (ManagementObject queryObj in searcher.Get()) { Console.WriteLine("-----------------------------------"); Console.WriteLine("MSNdis_80211_ServiceSetIdentifier instance"); Console.WriteLine("-----------------------------------"); if (queryObj["Ndis80211SsId"] == null) { //Console.WriteLine

How to extend volume using powershell?

独自空忆成欢 提交于 2020-01-23 16:57:09
问题 How to extend volume using powershell (I prefer WMI over powershell remoting) on remote computer ? OS is win XP sp3. 回答1: I ended up with somethin like this: Invoke-Command -ComputerName $compName -Credential $compCred -ScriptBlock {"rescan","select volume 2","extend" | diskpart} I'm still looking for better solution, if there is one. 回答2: There is a set of scripts Microsoft's Storage Team wrote to handle this that can also be hooked into System Insights as automated remediation actions:

How to extend volume using powershell?

僤鯓⒐⒋嵵緔 提交于 2020-01-23 16:56:30
问题 How to extend volume using powershell (I prefer WMI over powershell remoting) on remote computer ? OS is win XP sp3. 回答1: I ended up with somethin like this: Invoke-Command -ComputerName $compName -Credential $compCred -ScriptBlock {"rescan","select volume 2","extend" | diskpart} I'm still looking for better solution, if there is one. 回答2: There is a set of scripts Microsoft's Storage Team wrote to handle this that can also be hooked into System Insights as automated remediation actions:

List of SerialPorts queried using WMI differs from devicemanager?

扶醉桌前 提交于 2020-01-21 04:27:27
问题 I have the following serial ports listed in my devicemanager: COM3 COM4 (BT) COM5 (BT) COM6 (GlobeTrotter MO67xx - Control Interface) COM7 (GlobeTrotter MO67xx - GPS Control Interface) COM8 (GlobeTrotter MO67xx - GPS Data Interface) COM9 (GlobeTrotter MO67xx - Diagnostics Interface) COM11 (USB Serial Port) COM12 (USB Serial Port) COM45 (SUNIX COM Port) COM46 (SUNIX COM Port) The SUNIX COM ports are connected via an internal PCI-Card. The USB Serial Port is connected via USB (FDTI-chip) The