Retrieve the MotherBoard or BaseBoard details using WMI

Using this Function we can Retrieve the MotherBoard Details.



private void getMotherBoardDetails()
{

ManagementObjectSearcher objMOS = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BaseBoard");

foreach (ManagementObject objManagemnet in objMOS.Get())
{
try
{
using(StreamWriter objStreamWriter = new StreamWriter(@"D:\Sam.txt"))
{
objStreamWriter.WriteLine("======================================================================");
objStreamWriter.WriteLine(" Mother Board Details ");
objStreamWriter.WriteLine("======================================================================");
objStreamWriter.WriteLine("Caption :" + objManagemnet.GetPropertyValue("Caption").ToString());
objStreamWriter.WriteLine("CreationClassName :" + objManagemnet.GetPropertyValue("CreationClassName").ToString());
objStreamWriter.WriteLine("Description :" + objManagemnet.GetPropertyValue("Description").ToString());
objStreamWriter.WriteLine("InstallDate :" + Convert.ToDateTime(objManagemnet.GetPropertyValue("InstallDate")));
objStreamWriter.WriteLine("Manufacturer :" + objManagemnet.GetPropertyValue("Manufacturer").ToString());
objStreamWriter.WriteLine("Model :" + Convert.ToString(objManagemnet.GetPropertyValue("Model")));
objStreamWriter.WriteLine("Name :" + objManagemnet.GetPropertyValue("Name").ToString());
objStreamWriter.WriteLine("PartNumber :" + Convert.ToInt32 ( objManagemnet.GetPropertyValue("PartNumber")));
objStreamWriter.WriteLine("PoweredOn :" + objManagemnet.GetPropertyValue("PoweredOn").ToString());
objStreamWriter.WriteLine("Product :" + objManagemnet.GetPropertyValue("Product").ToString());
objStreamWriter.WriteLine("SerialNumber :" + objManagemnet.GetPropertyValue("SerialNumber").ToString());
objStreamWriter.WriteLine("SKU :" + Convert.ToString(objManagemnet.GetPropertyValue("SKU")));

objStreamWriter.WriteLine("Status :" + Convert.ToString(objManagemnet.GetPropertyValue("Status")));
objStreamWriter.WriteLine("Tag :" + Convert.ToString(objManagemnet.GetPropertyValue("Tag")));
objStreamWriter.WriteLine("Version :" + Convert.ToString(objManagemnet.GetPropertyValue("Version")));
objStreamWriter.WriteLine("Weight :" + Convert.ToString(objManagemnet.GetPropertyValue("Weight")));
objStreamWriter.WriteLine("Height :" + Convert.ToString(objManagemnet.GetPropertyValue("Height")));
objStreamWriter.WriteLine("PoweredOn :" + Convert.ToString(objManagemnet.GetPropertyValue("PoweredOn")));
}

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}


}



Comments

Guest Author: Loller26 Jul 2012

Thanks for this!! This is really useful!! :)

Guest Author: Cemil09 Aug 2012

Very Good thanks but i want mainbord's chipset info...



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: