I have the following vbscript code that returns the local IP address. It works great. I am trying to provide the same functionality in my winform .net app.
All the solutions I have come across involve using DNS. Any ideas on how to "port" this script for use in .net?
A different way to do this maybe?
Thanks!
Function GetIP()
Dim...
Hi
I am trying to launch .appref-ms (Click once) application on remote machine using WMI but could not get success. The below code works fine if i try to run notpad.exe
ManagementPath pm = new ManagementPath(@"\server\root\cimv2:Win32_process");
ManagementClass processClass = new ManagementClass(pm);
//Get an input...
I've been told by a coworker that if my WMI system information gathering queries are forward-only and/or read-only, they'll be quite faster. That makes sense. But how do I do it?
...
Is it possible to find out the service packs that are installed on a Windows 2000 machine using WMI?
...
I have a local application running with an user than have a group policy indicating this user can’t shutdown the pc.
And then I use your code, but when I ask by user and password to impersonate my app. I received the next error
System.Management.ManagementException: it’s not possible to use the user’s credentials for the local connecti...
Hello,
I've got some troubles with Get-WmiObject and usage of this object.
In case, I'm connecting to remote computer - which is not in AD, but in the internet.
I'm using credentials and I'm able to retrieve list of WMI classes, or object (to be specific, I want to work with Win32_Process) via commands:
$credential = Get-Credential
$...
I'm trying to determine if a laptop is connected to AC power.
The OS Im running under is WinPE.
My app is written in native C++.
WMI queries using Win32_Battery are not supported and the GetSystemPowerStatus API always returns '1' for ACLineStatus (running on AC power or not).
Any ideas?
Additonal investigation:
Just tried the API '...
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.
...
How to check current machine type? laptop or desktop ?
I got this from http://blog.csdn.net/antimatterworld/archive/2007/11/11/1878710.aspx ,it works well on my home machine(Win2003 on laptop), it returns "Portable", but failed on my work machine(Vista on laptop), it returns "Other".
here is the code:
public enum ChassisTypes
{
O...
Conditions:
Windows 98 SE
WMI not available
I have code that looks like this, written using my steroidal wrapping of VBScript using MSScript.
do
a = files.collectfiles( "c:\userver", "" )
for i = 0 to ubound( a )
f = a(i)
if strings.endswith( f, ".usv" ) then
d = files.readfilee( f )
on error resume next
executeglobal...
I am trying to use the following code to write out all processes started on a computer. My problem is that the EventArrived method is passed a EventArrivedEventArgs which has a NewEvent property of type ManagementBaseObject. This does not have a InvokeMethod method. Can I convert the NewEvent property to a ManagementObject some how, o...
I would like to query the domain wide settings of a specific group policy object. How do I do that in Powershell or WMI? For instance I would like to know the value for the password policy setting 'Minimum password length' that is configured in the GPO for the entire domain.
...
Hello everybody,
do u know perhaps a way (via script or program) to find out if e.g. a WMI script runs from a remote PC1 and performs some tasks in another PC2 when I am seating in a third PC: PC3
Assume that all PC belong to the same network and domain and have windows xp installed.
The reason for this that I administer a small netwo...
Recently I have been learning about WMI and WQL. I found out the list of Win32 classes (from MSDN) that I can query for but I am not able to find out the list of event classes (should be the subset of the list of Win32 classes isn't it ?) Does any one have a list or some kind of cheat sheet for this? I am jsut asking this out of curiosit...
I'm experiencing a memory leak when using WMI from Delphi 7 to query a (remote) pc. The memory leak only occurs on Windows 2003 (and Windows XP 64). Windows 2000 is fine, and so is Windows 2008. I'm wondering if anyone has experienced a similar problem.
The fact that the leak only occurs in certain versions of Windows implies that it mi...
I've inherited code that makes numerous remote WMI calls. When I repeatedly pause execution and look at the call-stack it's almost always in a ManagementScope.Connect() call. A new connection seems to be made with each WQL query.
Despite limited trial and error, I haven't found any big wins yet in improving the performance of the WMI ...
So I am exploring a Win 2008 Server machine with WMI queries on the Win32_NetworkAdapter class. This class is documented here: http://msdn.microsoft.com/en-us/library/aa394216(VS.85).aspx
Here's what it says about the possible values of that property. There's also an AdapterType property that returns the same information, only in the fo...
According to the documentation at http://msdn.microsoft.com/en-us/library/aa394102%28VS.85%29.aspx this property may assume the following string values:
"X86-based PC"
"MIPS-based PC"
"Alpha-based PC"
"Power PC"
"SH-x PC"
"StrongARM PC"
"64-bit Intel PC"
"64-bit Alpha PC"
"Unknown"
"X86-Nec98 PC"
Most of it is pretty obvious, but what...
I have two XP Pro SP3 machines. I disabled the firewall in both. The workgroup name is WORKGROUP. I have an administrator account with identical username/password in both. My code to connect is the following:
ConnectionOptions options = new ConnectionOptions();
options.Username = myUsername;
options.Password = myPassword;
...
I am trying to add info to a VBscript that will determine if the monitor(s) connected to the current machine is an LCD or CRT. I know I can get the EDID info from HKLM\System\CCS\Enum\DISPLAY but I can't use that to determine the monitor type. And the only consistent info I can grab from the WMI classes Win32_DesktopMonitor, Win32_Disp...