WMI / system information
-
Hi. I'm new to WMI, nd I'm trying to create an application that pings a computer and get the following information: - IP adress - Domain - UserName - Time since last boot - Memory - CPU - OS Version - Service pack version - Current pingtime (datetime.now). I'm using both the registry and WMI to get the needed information, but I would like to know if anyone could help me writing - or guide me to create a WMI call that would get all that information? I'm selecting the host from a database, and the data is afterword stored in the same table. Also, if I could get some help reading an OU in a Domain to list all hosts - I know the path to the ou, but not how to read data fromm it. Regards Jan.
-
Hi. I'm new to WMI, nd I'm trying to create an application that pings a computer and get the following information: - IP adress - Domain - UserName - Time since last boot - Memory - CPU - OS Version - Service pack version - Current pingtime (datetime.now). I'm using both the registry and WMI to get the needed information, but I would like to know if anyone could help me writing - or guide me to create a WMI call that would get all that information? I'm selecting the host from a database, and the data is afterword stored in the same table. Also, if I could get some help reading an OU in a Domain to list all hosts - I know the path to the ou, but not how to read data fromm it. Regards Jan.
Member 1541838 wrote:
that pings a computer
Do you want to access remote computer information or local system? for local system details: OS version: System.Environment.OSVersion.ToString () USER NAME: System.Windows.Forms.SystemInformation.UserName OR Environment.UserName IP ADDRESS: http://www.codeproject.com/KB/cs/network.aspx[^] http://www.c-sharpcorner.com/UploadFile/mahesh/get_ip11152005064604AM/get_ip.aspx[^] http://www.netomatix.com/MachineIp.aspx[^]
First and the Foremost: FIGHT TO WIN
MySite:
HariOmPrakash.InFo -
Hi. I'm new to WMI, nd I'm trying to create an application that pings a computer and get the following information: - IP adress - Domain - UserName - Time since last boot - Memory - CPU - OS Version - Service pack version - Current pingtime (datetime.now). I'm using both the registry and WMI to get the needed information, but I would like to know if anyone could help me writing - or guide me to create a WMI call that would get all that information? I'm selecting the host from a database, and the data is afterword stored in the same table. Also, if I could get some help reading an OU in a Domain to list all hosts - I know the path to the ou, but not how to read data fromm it. Regards Jan.
GET OS INFORMATION you have to use ManagementClass to access system details
System.Management.ManagementClass managementClass = new System.Management.ManagementClass("Win32_OperatingSystem"); foreach (System.Management.ManagementObject managementObject in managementClass.GetInstances()) { str1 = managementObject["Manufacturer"].ToString(); str2 = managementObject["Version"].ToString(); str3 = managementObject["Caption"].ToString(); }
First and the Foremost: FIGHT TO WIN
MySite:
HariOmPrakash.InFo -
Hi. I'm new to WMI, nd I'm trying to create an application that pings a computer and get the following information: - IP adress - Domain - UserName - Time since last boot - Memory - CPU - OS Version - Service pack version - Current pingtime (datetime.now). I'm using both the registry and WMI to get the needed information, but I would like to know if anyone could help me writing - or guide me to create a WMI call that would get all that information? I'm selecting the host from a database, and the data is afterword stored in the same table. Also, if I could get some help reading an OU in a Domain to list all hosts - I know the path to the ou, but not how to read data fromm it. Regards Jan.
Jan, I think this will help out a lot. It helped me, because sometimes WMI can be a nightmare... WMI Code Creator v1.0[^] -David