boy

boy

  • NA
  • 1
  • 0

How to get OS and other computer information of those pc connected on the network

Jan 30 2009 1:09 AM
Hi everyone, can anyone help me to find a way on how to get OS and other computer information of those pc connected in network once the pc listed in the listview is being clicked it will show it's OS details and other computer related info.. as of now I am using System.Management and mingling with this code:

                ManagementPath path = new ManagementPath(String.Format("\\\\strHostName\\root\\cimv2"));
                ManagementScope ms = new ManagementScope(path);

                ObjectQuery oq = new ObjectQuery("Select * from Win32_OperatingSystem");
                ManagementObjectSearcher mos = new ManagementObjectSearcher(ms,oq);

                ManagementObjectCollection queryCollection = mos.Get();

                foreach (ManagementObject mon in queryCollection)
                {
                    richTextBox2.Text = mon["Caption"].ToString() + "\n" + "Version: " + mon["Version"].ToString() + "\n" + "Manufacturer: " + mon["Manufacturer"].ToString() + "\n" + "Computer Name: " + mon["csname"].ToString() + "\n" + "Windows Directory: " + mon["WindowsDirectory"].ToString() + "\n" + "Serial Number: " + mon["SerialNumber"].ToString();

                }
But once i clicked a pc on listview an error pop up and it says..the RPC server is unavailabe...I already turned off the firewalls of those pc on the network and now i don't know what to do...can u please help me solve this problem..
Your urgent help will be highly appreciated...

Thanks....

Answers (1)