Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Can Collect complete remote system information using WMI in C#.

Regards,
Purnananda Behera.
Posted

 
Share this answer
 
Yes, Try the following code

ConnectionOptions connOpt = new ConnectionOptions();
connOpt .Username = "username";
connOpt .Password = "password";
ManagementScope mScope = new ManagementScope("\\\\yourIPOrMachineName\\root\\CIMV2", connOpt);
mScope.Connect();
ObjectQuery query = new ObjectQuery("Query");
//Replace above Query with required wmi query. 
ManagementObjectSearcher mOSearcher = new ManagementObjectSearcher(mScope, query);
ManagementObjectCollection oReturnCollection = mOSearcher.Get();
foreach (ManagementObject objInfo in oReturnCollection)
{
  // Fetch the required info from objInfo 
} 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900