Win32_Account class

The Win32_Account abstract WMI class contains information about user accounts and group accounts known to the computer system running Windows. User or group names recognized by a Windows domain are descendants (or members) of this class.

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

class Win32_Account : CIM_LogicalElement
{
  string   Caption;
  string   Description;
  string   Domain;
  datetime InstallDate;
  boolean  LocalAccount;
  string   Name;
  string   SID;
  uint8    SIDType;
  string   Status;
};

Members

The Win32_Account class has these types of members:

Properties

The Win32_Account class has these properties.

Caption
Data type: string
Access type: Read-only
Qualifiers: MaxLen (64)

Short description of the object. This property is inherited from the CIM_ManagedSystemElement class.

Description
Data type: string
Access type: Read-only

Description of the object. This property is inherited from the CIM_ManagedSystemElement class.

Domain
Data type: string
Access type: Read-only
Qualifiers: Key

Name of the Windows domain to which a group or user belongs.

Example: "NA-SALES"

InstallDate
Data type: datetime
Access type: Read-only

Date and time that the object was installed. This property does not require a value to indicate that the object is installed. This property is inherited from the CIM_ManagedSystemElement class.

LocalAccount
Data type: boolean
Access type: Read-only

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".

Name
Data type: string
Access type: Read-only
Qualifiers: Key

Name of the Windows system account on the domain specified by the Domain property of this class. This property overrides the Name property inherited from CIM_ManagedSystemElement.

SID
Data type: string
Access type: Read-only

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.

SIDType
Data type: uint8
Access type: Read-only

Enumerated values that specify the type of security identifier (SID).

SidTypeUser (1)
SidTypeGroup (2)
SidTypeDomain (3)
SidTypeAlias (4)
SidTypeWellKnownGroup (5)
SidTypeDeletedAccount (6)
SidTypeInvalid (7)
SidTypeUnknown (8)
SidTypeComputer (9)
Status
Data type: string
Access type: Read-only

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicts a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", can apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states.

This property is inherited from the CIM_ManagedSystemElement class.

The values are:

"OK"

"Error"

"Degraded"

"Unknown"

"Pred Fail"

"Starting"

"Stopping"

"Service"

Remarks

The Win32_Account class is derived from CIM_LogicalElement.

Examples

The following PowerShell code retrieves the local accounts.


Get-WmiObject Win32_Account -Filter "Domain='$Env:ComputerName'"

The following PowerShell code retrieves the domain accounts.


 Get-WmiObject Win32_Account -Filter "Domain='$Env:UserDomain'" 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Operating System Classes

 

 

Show:
© 2014 Microsoft