Win32_Group class
The Win32_Group WMI class represents data about a group account. A group account allows access privileges to be changed for a list of users. Example: Marketing2.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.
Syntax
[Dynamic, Provider("CIMWin32"), UUID("{8502C4CB-5FBB-11D2-AAC1-006008C78BC7}"), AMENDMENT]
class Win32_Group : Win32_Account
{
string Caption;
string Description;
datetime InstallDate;
string Status;
boolean LocalAccount;
string SID;
uint8 SIDType;
string Domain;
string Name;
};
Members
The Win32_Group class has these types of members:
Methods
The Win32_Group class has these methods.
| Method | Description |
|---|---|
| Rename |
Changes the group name. |
Properties
The Win32_Group class has these properties.
- Caption
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (64), DisplayName ("Caption")
A short textual description of the object.
This property is inherited from CIM_ManagedSystemElement.
- Description
-
- Data type: string
- Access type: Read-only
- Qualifiers: DisplayName ("Description")
A textual description of the object.
This property is inherited from CIM_ManagedSystemElement.
- Domain
-
- Data type: string
- Access type: Read-only
- Qualifiers: Override ("Domain"), MappingStrings ("Win32API|Network Management Functions|domainname")
Name of the Windows domain to which the group account belongs.
Example: "NA-SALES"
- InstallDate
-
- Data type: datetime
- Access type: Read-only
- Qualifiers: MappingStrings ("MIF.DMTF|ComponentID|001.5"), DisplayName ("Install Date")
Indicates when the object was installed. Lack of a value does not indicate that the object is not installed.
This property is inherited from CIM_ManagedSystemElement.
- LocalAccount
-
- Data type: boolean
- Access type: Read-only
- Qualifiers: Fixed
If TRUE, the account is defined on the local machine. To retrieve only accounts defined on the local machine, design a query that includes the condition "LocalAccount=TRUE".
This property is inherited from Win32_Account.
- Name
-
- Data type: string
- Access type: Read-only
- Qualifiers: Override ("Name"), MappingStrings ("Win32API|Network Management Structures|name")
Name of the Windows group account on the domain specified by the Domain property of this class.
- SID
-
- Data type: string
- Access type: Read-only
- Qualifiers: Fixed, MappingStrings ("Win32API|Security Identifiers (SIDs)")
Security identifier (SID) for this account. A SID is a string value of variable length used to identify a trustee. Each account has a unique SID issued by an authority (such as a Windows domain), stored in a security database. When a user logs on, the system retrieves the user's SID from the database and places it in the user's access token. The system uses the SID in the user's access token to identify the user in all subsequent interactions with Windows security. When a SID has been used as the unique identifier for a user or group, it cannot be used again to identify another user or group.
This property is inherited from Win32_Account.
- SIDType
-
- Data type: uint8
- Access type: Read-only
- Qualifiers: Fixed, MappingStrings ("Win32API|Access Control Enumeration Types|SID_NAME_USE")
Enumerated values that specify the type of security identifier (SID).
This property is inherited from Win32_Account.
- Status
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (10), DisplayName ("Status")
String that indicates the current status of the object. Operational and non-operational status can be defined. Operational status can include "OK", "Degraded", and "Pred Fail". "Pred Fail" indicates that an element is functioning properly, but is predicting a failure (for example, a SMART-enabled hard disk drive).
Non-operational status can include "Error", "Starting", "Stopping", and "Service". "Service" can apply during disk mirror-resilvering, reloading a user permissions list, or other administrative work. Not all such work is online, but the managed element is neither "OK" nor in one of the other states.
This property is inherited from CIM_ManagedSystemElement.
Values include the following:
Remarks
The Win32_Group class is derived from Win32_Account.
Examples
The following code, taken from the List Local Groups Using WMI VBScript code example on TechNet Gallery, uses Win32_Group to return information about the local groups found on a computer.
On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * from Win32_Group Where LocalAccount = True") For Each objItem in colItems Wscript.Echo "Caption: " & objItem.Caption Wscript.Echo "Description: " & objItem.Description Wscript.Echo "Domain: " & objItem.Domain Wscript.Echo "Local Account: " & objItem.LocalAccount Wscript.Echo "Name: " & objItem.Name Wscript.Echo "SID: " & objItem.SID Wscript.Echo "SID Type: " & objItem.SIDType Wscript.Echo "Status: " & objItem.Status Wscript.Echo Next
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Namespace |
Root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also