wmi

How do I remotely obtain a system's network shares and connections?

I'm looking for a way to obtain information similar to the following console applications, remotely: net use net share netstat -ano However, I need to be able to do this without running a 3rd party application on the system. This effectively rules out using psexec to execute the command remotely, because psexec would then be installe...

WMI, WQL, Management Event Objects, MEWatcher Etc, Tutorials (C#)???

Anybody got any any tutorials that cover these subjects ... the official MS 70-536 book covers this but I don't want to take any chances as I want additional reading materials problem is, its proving difficult to find anything on it. It's a fairly big subject so am hoping somone on here as here as got some good reading materials on that...

Using ManagementObject to retrieve a single WMI property

This probably isn't the best way, but I am currently retrieving the amount of RAM on a machine using: manageObjSearch.Query = new ObjectQuery("SELECT TotalVisibleMemorySize FROM Win32_OperatingSystem"); manageObjCol = manageObjSearch.Get(); foreach (ManagementObject mo in manageObjCol) sizeInKilobytes = Convert.ToInt64(mo["TotalVisibl...

.NET application per-machine/per-user licensing

I am about to implement a very basic licensing feature for my application. A serial number may be granted per-machine (or per-operating-system) or per-user (as for CAL in Windows Server: if my application is used by several users on one machine or if it is used by one user on several machines). For per-operating-system licensing, I use...

Get User SID From Logon ID (Windows XP and Up)

I have a Windows service that needs to access registry hives under HKEY_USERS when users log on, either locally or via Terminal Server. I'm using a WMI query on win32_logonsession to receive events when users log on, and one of the properties I get from that query is a LogonId. To figure out which registry hive I need to access, now, I n...

Creating a service that takes parameters with WMI

I want to create a service that takes some parameters. How do I do this with WMI? In the commandline, it was sc create ServiceName binPath= ""C:\Path\Service.exe\" /Service somefile1.xml somefile2.xml" start=auto DisplayName="DisplayName" I have tried to use ManagementBaseObject inParams = managementClass.GetMethodParameters("creat...

what's the UNC path for local computer from a remote machine ?

I am writing a small utility program in IronPython to install applications on remote machine using managementclass which uses WMI. Now, the script would install an application on Machine_B from Machine_A, it works fine as long as you have the msi file on the local drive of the Target machine (Machine_B, in this case). I want to be able ...

How to using Mono for windows to Access WMI to get hardware Id?

Hi, folks Recently,I need run my winforms App on mono for windows platform,But i am using WMI to get MAC address and CPU ID in my original code,switch to Mono for Windows,it does not working. I found that "System.Management.dll" APIs is not implemented in Mono. How can i do?How to get CPU ID,MAC Address, Hard Disk Serial Number,and Mot...

Possible values for ManagementObject.GetMethodParameters method?

Hi, I only know some of them such as "CreateVirtualDirectory" and "SetDatabaseConnection" etc but where can I get a list of all possible values(method names) for the ManagementObject.GetMethodParameters method? Thanks. ...

Process-to-port mapping with SNMP and/or wmi/wmic in java

I'm trying to use SNMP to map outgoing ports on my host computer with the application running on the computer that is responsible for that communication. When running "netstat -ano" I get access to Protocol, Local Address (with port), Foreign Address (with port), State and PID. But I want to do this entirely without having to execute "c...

get disk manufacturer using WMI

how get USB flash(key) manufacturer name with C#? for example WD, Hama, Kingston... Now i with: "disk["Manufacturer"]", get: "Standard disk driver" string drive = "h"; ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"" + drive + ":\""); disk.Get(); Console.WriteLine(disk["VolumeSerialNumber"].ToString()); Co...

How do I use WMI with Delphi without drastically increasing the application's file size?

I am using Delphi 2010, and when I created a console application that prints "Hello World", it takes 111 kb. If I want to query WMI with Delphi, I add WBEMScripting_TLB, ActiveX, and Variants units to my project. If I perform a simple WMI query, my executable size jumps to 810 kb. I Is there anyway to query WMI without such a large addi...

SMO ManagedComputer.ServiceInstances is empty

I am trying to use SMO (VS 2010, SQL Server 2008) to connect to SQL Server and view the server protocol configuration. I can connect and list the Services and ClientProtocols as well as the account MSSQLSERVER service is running under. However, the ServerInstances collection is empty. The only instance on the target server is the default...

What is the 64 bit equivalent of Win32_OperatingSystem?

I inherited a script running on Windows Server 2003 that I need to port to Windows Server 2008. The current script is: strComputer = "servernamexyz" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Shutdown)}!\\" & _ strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.E...

Get the Startup List via WMI

How do I gat the the full .exe path Let us assume with the following string strt["Command"].ToString(); I get this output C:\Program Files\Analog Devices\SoundMAX\soundmax.exe /tray but how to I get C:\Program Files\Analog Devices\SoundMAX\soundmax.exe ManagementClass mangnmt = new ManagementClass("Win32_StartupCommand...

Deny access to run certain installed software for users

I have a list of installed software, obtained from WMI class select * from Win32_Product. I'd like to deny execution rights for some users on certain software like so: find the path to installed software recursively remove execution rights I find the path to installed software from Win32_Product InstallLocation column. But the PROBLE...

Exception while ManagementEventWatcher(WMI) to notify events from remote machine

Hi all, I am trying to get notification from a remote machine 's event viewer using WMI and C#. I am able to connect the system and also get event log by using ManagementObjectSearcher. But when I tried to use ManagementEventWatcher.Start method I am getting a exception Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDEN...

I'm trying to run a command using WMI.

This is my code: a button is clicked and the text in a textbox is taken for the remotePC. I can run it locally but when I try to run it remotely it will not work, I think it has something to do with using WMI to run a shared file? public void IPXFER(string RemotePC) { object[] theProcessToRun = { @"\\network-share\ipxfer\ipxfer...

Launch command on remote Windows machine, given admin credentials

I have a Windows Server 2008 instance on Amazon EC2 (Amazon's cloud compute platform, which provides VMs in the cloud). It has an external IP, and I have an admin account on the box. I would like to 'bootstrap' this instance remotely i.e. I want to run commands to download, install and configure apps on it, all without having to log on e...

how to get system information in guest account c#?

Hi, I would like to know how to get system information such as OS name and version, system manufactor... I can get this information by WMI qureies, but WMI queries are not working for guest account. Any idea? Thanks. ...