Jitesh Byahut 2/16/2014 1945

Win32_Group in WMI C# Asp.Net

Here we are retrieving Group users details of Computer.

Use namespace System.Management

using System.Management;

 

public partial class Win_Win32_Group : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        ManagementObjectSearcher objgroup = new ManagementObjectSearcher("select * from Win32_Group");

 

        foreach (ManagementObject obj in objgroup.Get())

        {

            Response.Write("Name  -  " + obj["Name"] + "</br>");

            Response.Write("Domain  -  " + obj["Domain"] + "</br>");

            Response.Write("Caption  -  " + obj["Caption"] + "</br>");

            Response.Write("Description  -  " + obj["Description"] + "</br>");

            Response.Write("LocalAccount  -  " + obj["LocalAccount"] + "</br>");

            Response.Write("Status  -  " + obj["Status"] + "</br>");

            Response.Write("--------------------------------</br>");

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page