wmi

Create/delete disk partitions via WMI

Hi, there is a way to create/delete disk partitions via WMI ? I'm already able to mount/unmount virtual disks (vhd) and list their partitions. ...

How to get PCIController info with WMI query?

I am using the following code to get some info about my PCIController try { ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from Win32_PCIController"); foreach (ManagementObject cdrom in searcher.Get()) { Console.WriteLine("PCIController Name: {0}", cdrom.GetProperty...

IIS 6.0: what is the WMI equivalent of "Convert Folder To Application"?

Basically, imagine you need to automate these steps: Open Internet Information Services. Find the web site, find the folder, right click the folder and select properties. Click the Directory folder. Under Applications settings, click the Create button. The application is now created. Click OK to finish. (click for a pictoral walk...

querying extended File Properties using WMI

Is there a WMI namespace and a class that can be used to obtain the extended properties of a file, such as Owner, Author, Title, Subject, Category, Comments? please suggest. ...

Remote management using WMI XP PC's in a work group

Hi all, Is it not possible to remotely manage XP sp2 PC from another XP sp3 computer using WMI where both of PC are in a work group? I have run wmimgmt.msc right click WMI control the connect to another PC. I have also used WMI Tools which I downloaded. I have Administrative account on the remote computer. I tried everything I found on...

Programmatically retrieve disconnected network adapter information in .NET

I have an application written in C# that needs to retrieve information like IP address, subnet mask from a disconnected network adapter. I've tried using various methods such as WMI and the .NET NetworkAdapter class but they don't return any useful data when the network adapter is disconnected. I'm pretty sure Windows keeps this informa...

Using ManagementClass.Getinstances() from IronPython

I have an IronPython script that looks for current running processes using WMI. The code looks like this: import clr clr.AddReference('System.Management') from System.Management import ManagementClass from System import Array mc = ManagementClass('Win32_Processes') procs = mc.GetInstances() That last line where I call the GetInstances...

Printer log viewer

Can some one guide me on how to get the log for a network printer from server? mainly user,ip,computer name,document name, page count Thank you ...

WMI Win32_OperatingSystem OSArchitecture field causes exception

I am trying to get information on the version of Windows installed from WMI. Most fields work. I can get the operating system "Name" as well as the "Version", both are fields of the Win32_OperatingSystem object I have. But another field "OSArchitecture" generates an exception ("Not found"). strScope = "\\" + strServer + "\root\CIMV...

I have a SID of a user account, and I want the SIDs of the groups it belongs to

This has to be obtained from a remote machine. The following query works not for SIDs, but for group and account names. "SELECT GroupComponent FROM Win32_GroupUser WHERE PartComponent = \"Win32_UserAccount.Domain='" + accountDomain + "',Name='" + accountName + "'\"" The Win32_Group objects it returns come in the forms of strings, and ...

what are registry settings to enable TCP on SQL Server 2005 and 2008?

I want to programatically enable TCP connections on SQL Server. I believe we can achieve this by modifying registry entries and restarting SQL Server service. What registry should I edit? ...

InstallUtil Publishing WMI Schema to 64 Bit Directory Instead of 32 Bit Directory

This is similar to this question, but it doesn't look like a good solution was ever determined, so I'm opening a new one with clarified details. We wrote a .NET service, which among other things, publishes some of the class hierarchy using WMI. On a 64-Bit machine (running Windows 2008 R2 Server), we are running the 32-bit version of In...

Identify CPU P-State and current frequency inside Hyper-V guest

On my Hyper-V host I change the CPU P-state through power management policies and I see a frequency change. In the guest, the maximum frequency is always reported. How can I get the real CPU frequency inside the virtual machine? ...

How to read an IIS 6 Website's Directory Structure using WMI?

I need to read a website's folders using WMI and C# in IIS 6.0. I am able to read the Virtual directories and applications using the "IISWebVirtualDirSetting" class. However the physical folders located inside a website cannot be read using this class. And for my case i need to read sub folders located within a website and later on set...

weird access denied issue with WMI

I'm seeing a weird access denied issue with WMI. we're trying to create a diff disk based on a parent vhd in a windows service app that runs under network service (machine account is an admin). everything works fine when we create the diff disk on other machine using wmi - we use an admin user account. however, we cannot do this on a loc...

C# WMI Eventwatcher code stopped working on Windows 7 with security exception

This is code that worked fine on Windows XP for years. User is not local administrator. WqlEventQuery query = new WqlEventQuery("SELECT * FROM Win32_ProcessStopTrace"); ConnectionOptions co = new ConnectionOptions(); co.EnablePrivileges = true; ManagementEventWatcher watcher = new ManagementEventWatcher(new ManagementScope(@"root\cimv2"...

motherboard, network cards, ports, printer detection tools for .net

does anybody have a hardware detection api for .net? ...

Is Win32_PerfFormattedData_PerfDisk_PhysicalDisk missing from WMI in Vista?

From what I understand, the output from the following script should include "Win32_PerfRawData_PerfDisk_PhysicalDisk" in Windows XP and higher, but it doesn't for me in Vista Business 32-bit Service Pack 2. Thus far I have been very unsuccessful googling for information about this performance class. strComputer = "." Set objWMIService=...

WMI: Create Method of the Win32_Service Class

Hello, I'm trying to use the Create method of the Win32_Service class, but when I call the InvokeMethod, I receive this exception: System.Management.ManagementException: Invalid method at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode) at System.Management.ManagementObject.InvokeMethod(String met...

WMI: Editing the Registry Remotely

I'm trying to use the following code (poorly written, but it's just a proof of concept) to edit the registry of a computer on a domain. I have a domain account, and I've verified that the domain admin group is present in the local admin group on the machines I'm attempting to affect. I've connected to these other machines to perform ot...