wmi

how to start a remote process with command line arguments?

I was playing around with WMI to try to get this to work, but I've had 3 issues. 1: Anything I start doesn't show up with an application window on the remote system. 2: Most of the system's I've tried i'm getting access denied messages on. 3: How do I pass command line arguments O_O. ...

How to get the list of SqlInstances of a paricular machine

Can anyone tell me how to get remote Sqlserver instances using c# and SMO or any api? I have a remote server name "RemoteMC", which has 2 instances of sql server: "RemoteMc" and "RemoteMC\sqlexpress" I try to get the instances in code like this: Server srv=new Server("RemoteMC"); DataTable dt=SmoApplication.EnumAvailableSqlServer(true...

WIN32_Processor::Is ProcessorId Unique for all computers

hi.. i want to use some thing unique for a licensing system. i decided to use ProcessorID from Win32_Processor Management class. i tried on two different systems with same processor type.. it shows me same processorID for both system. i am using this code public static String GetCPUId() { String processorID = ""; ...

WMI Cheatsheet?

Is there a cheatsheet available for WMI? Like what can be queried, where to query it from? ...

How to get the number of processors on a 64-bit machine?

How can I find the number CPUs on 64 bit window 2003 servers? The answers in this thread did not work. Using Win32_ComputerSystem.NumberOfProcessors returns none. I would prefer a way to do it using WMI if possible. I have a script that already his all the machines I need this info from grabbing disk info. Thanks ...

remote connect to a network computer

I'm having an issue connecting to some PC on the network via WMI, psexec, even Computer Management. I would like to know what is prevening prevent a remote connect. Say I have 10 pcs on a network, i can remote to 7 and not the other 3 on the same subnet. I have looked at Personal Firewalls, Windows Firewall, account on adminstrators gro...

Any faster method to get Volume Serial number ?

Hi I'm using this code to generate machine signature. But it's take noticeable time to execute. Wonder why it's that slow ? Any faster method recommended ? Public Shared Function DriveSN(ByVal DriveLetter As String) As String Dim disk As ManagementObject = New ManagementObject(String.Format("Win32_Logicaldisk='{0}'", DriveLetter))...

Remote WMI StdRegProv GetString Access Denied

I'm attempting to use WMI to access a registry remotely via powershell. I'm using the following code to do this: $regUserPass = ConvertTo-SecureString -string "secret" -AsPlainText -Force $credentials = new-object System.Management.Automation.PSCredential("username", $regUserPass) $wmiReg = Get-WmiObject -list -namespace root\default -c...

What is the preferred way to interact with WMI using LINQ

I've seem some projects out there and was wondering if anyone had any feedback. The level of maturity of these projects seems low. ...

Reliably detecting OS architecture in a Windows Desktop Gadget

I have some Javascript code that will programmatically register an COM interop assembly by writing all the necessary keys and values to the registry. An older version of this COM object was written in VB6 and didn't work correctly on x64 versions of Windows unless the user manually ran the x86 sidebar.exe, so some of our users would hav...

How to obtain a registry value from a remote machine if I don't know its type? (C#)

Depending on what value type is stored, I have to use one of the following methods: GetBinaryValue GetDWORDValue GetExpandedStringValue GetMultiStringValue GetStringValue I would like not to have to try all five if all I know about a value is the hive, the key, and the value name. Is there a way to do that? I'm using WMI, but if the o...

System.Management.ManagementEventWatcher - Recovering From Disconnection

I am attempting to build an application that can monitor multiple remote machines through WMI. As a C# developer, I have chosen to utilize the System.Management namespace. For performance and scalability reasons, I would much prefer to use an event-driven method of gathering information than a poll-based one. As such, I have been inve...

Automatically Restarting a chat server application on system restart

I developed a chat application with an attendant chat server. Everything is working fine. The issue now is the fact that whenever the chat server goes down (for instance, the server system shuts down as a result of power failure or some other problem), by the time the server system come back on, the chat server would have to be restarted...

How can I find the Harddisk Device Serial Number without using the WMI in .NET?

I want to get the hardwired serial number from the hard disk but NOT using WMI. I tried using WMI code, and it doesn't work on my machine for sure. So is there any alternative in .NET for finding the Serial Number of a physical hard disk? ...

Function call could not be evaluated timed out

Hi, I wrote some basic code in C# like so: //Connection credentials to the remote computer - not needed if the logged in account has access ConnectionOptions oConn = new ConnectionOptions(); oConn.Username = ""; oConn.Password = ""; System.Management.ManagementScope oMs = new System.Management.ManagementScope("\\MachineX", oConn); ...

What could cause a long delay after reading events from WMI using Vb.Net

I have a windows user control that reads events from the application log of a remote server. I can read in the information alright, and it appears to happen very quickly, however the thread hangs up for about 30 seconds afterwards and keeps my application from displaying the log. I am afraid that this is probably caused by my lack of e...

How to get CPU temperature?

I need to gather some system's information for the application I'm developing. The memory available and the CPU load are easy to get using C#. Unfortunately, the CPU temperature it's not that easy. I have tried using WMI but I couldn't get anything using Win32_TemperatureProbe or MSAcpi_ThermalZoneTemperature Has anybody already de...

C# Detect Remote Application Failure

Does anyone know of a way to detect if a remote app has failed/crashed? I'm meaning when it becomes unusable - you'd usually see "Not Responding" in the title bar, in this case - but the key is that the app is still running; therefore just finding the process no longer running is not enough. WMI does not support use of System.Diagnostic...

WMI/VBS/HTML System Information Script

Hey guys; havin' a problem with this code here; can't seem to work out whats goin' wrong with it. All other variables seem to print fine in the HTML ouput; but I get an error that relates to the cputype variable. I get the following error C:\Users\Methical\Desktop\sysinfo.vbs(235,1) Microsoft VBScript runtime error: Invalid proced...

How to check if a IIS directory is virtual directory or not?

I am trying to find a way to write a script which will check if a IIS 6 directory is a virtual directory or not (see image below - I would like to see if TestMPIService is a virtual dir or not). I tried with Powershell and WMI, but I am unable to find that information anywhere. Anybody has an idea how to do such thing? ...