windows_snapshot/operating_system/
users.rs

1//! The Users subcategory groups classes that represent user account information, such as group membership details.
2//!
3//! | Class                                                                 | Description                                                                                                                                      |
4//! |-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
5//! | [**Win32\_Account**](win32-account)                               | Instance class<br/> Represents information about user accounts and group accounts known to the computer system running Windows.<br/> |
6//! | [**Win32\_Group**](win32-group)                                   | Instance class<br/> Represents data about a group account.<br/>                                                                      |
7//! | [**Win32\_GroupInDomain**](/previous-versions/windows/desktop/cimwin32a/win32-groupindomain)                   | Association class<br/> Identifies the group accounts associated with a Windows NT domain.<br/>                                       |
8//! | [**Win32\_GroupUser**](win32-groupuser)                           | Association class<br/> Relates a group and an account that is a member of that group.<br/>                                           |
9//! | [**Win32\_LogonSession**](win32-logonsession)                     | Instance class<br/> Describes the logon session or sessions associated with a user logged on to Windows.<br/>                        |
10//! | [**Win32\_LogonSessionMappedDisk**](/windows/desktop/CIMWin32Prov/win32-logonsessionmappeddisk) | Instance class<br/> Represents the mapped logical disks associated with the session.<br/>                                            |
11//! | [**Win32\_NetworkLoginProfile**](win32-networkloginprofile)       | Instance class<br/> Represents the network login information of a specific user on a computer system running Windows.<br/>           |
12//! | [**Win32\_SystemAccount**](win32-systemaccount)                   | Instance class<br/> Represents a system account.<br/>                                                                                |
13//! | [**Win32\_UserAccount**](win32-useraccount)                       | Instance class<br/> Represents information about a user account on a computer system running Windows.<br/>                           |
14//! | [**Win32\_UserInDomain**](/previous-versions/windows/desktop/cimwin32a/win32-userindomain)                     | Association class<br/> Relates a user account and a Windows NT domain.<br/>                                                          |
15
16use crate::update;
17use serde::{Deserialize, Serialize};
18use std::time::SystemTime;
19use wmi::{COMLibrary, WMIConnection, WMIDateTime};
20
21/// Represents the state of Windows User Accounts
22#[derive(Deserialize, Serialize, Debug, Clone)]
23pub struct UserAccounts {
24    /// Sequence of windows User Accounts
25    pub user_accounts: Vec<Win32_UserAccount>,
26    /// When was the record last updated
27    pub last_updated: SystemTime,
28}
29
30update!(UserAccounts, user_accounts);
31
32/// Represents the state of Windows user accounts and group accounts
33#[derive(Deserialize, Serialize, Debug, Clone)]
34pub struct Accounts {
35    /// Sequence of windows Accounts
36    pub accounts: Vec<Win32_Account>,
37    /// When was the record last updated
38    pub last_updated: SystemTime,
39}
40
41update!(Accounts, accounts);
42
43/// Represents the state of Windows data about a group account
44#[derive(Deserialize, Serialize, Debug, Clone)]
45pub struct Groups {
46    /// Sequence of windows Group
47    pub groups: Vec<Win32_Group>,
48    /// When was the record last updated
49    pub last_updated: SystemTime,
50}
51
52update!(Groups, groups);
53
54/// Represents the state of Windows data about logon session or sessions associated with a user logged
55#[derive(Deserialize, Serialize, Debug, Clone)]
56pub struct LogonSessions {
57    /// Sequence of windows logon sessions
58    pub logon_sessions: Vec<Win32_LogonSession>,
59    /// When was the record last updated
60    pub last_updated: SystemTime,
61}
62
63update!(LogonSessions, logon_sessions);
64
65/// Represents the state of Windows data about network login information
66#[derive(Deserialize, Serialize, Debug, Clone)]
67pub struct NetworkLoginProfiles {
68    /// Sequence of windows network login
69    pub network_login_profiles: Vec<Win32_NetworkLoginProfile>,
70    /// When was the record last updated
71    pub last_updated: SystemTime,
72}
73
74update!(NetworkLoginProfiles, network_login_profiles);
75
76/// Represents the state of Windows system accounts.
77#[derive(Deserialize, Serialize, Debug, Clone)]
78pub struct SystemAccounts {
79    /// Sequence of windows SystemAccounts
80    pub system_accounts: Vec<Win32_SystemAccount>,
81    /// When was the record last updated
82    pub last_updated: SystemTime,
83}
84
85update!(SystemAccounts, system_accounts);
86
87/// The `Win32_UserAccount` WMI class contains information about a user account on a computer system
88/// running Windows.
89///
90/// Note: Because both the Name and Domain are key properties, enumerating Win32_UserAccount on a
91/// large network can negatively affect performance. Calling GetObject or querying for a specific
92/// instance has less impact.
93///
94/// <https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-useraccount>
95#[derive(Default, Deserialize, Serialize, Debug, Clone)]
96#[allow(non_snake_case)]
97#[allow(non_camel_case_types)]
98pub struct Win32_UserAccount {
99    /// Flags that describe the characteristics of a Windows user account.
100    ///
101    /// - Temporary duplicate account (256): UF_TEMP_DUPLICATE_ACCOUNT: Local user account for
102    /// users who have a primary account in another domain. This account provides user access to
103    /// this domain only—not to any domain that trusts this domain.
104    ///
105    /// - Normal account (512): UF_NORMAL_ACCOUNT: Default account type that represents a typical user.
106    ///
107    /// - Interdomain trust account (2048): UF_INTERDOMAIN_TRUST_ACCOUNT: Account for a system
108    /// domain that trusts other domains.
109    ///
110    /// - Workstation trust account (4096): UF_WORKSTATION_TRUST_ACCOUNT: Computer account for a
111    /// computer system running Windows that is a member of this domain.
112    ///
113    /// - Server trust account (8192): UF_SERVER_TRUST_ACCOUNT: Account for a system backup domain
114    /// controller that is a member of this domain.
115    pub AccountType: Option<u32>,
116    /// Domain and username of the account.
117    pub Caption: Option<String>,
118    /// Description of the account.
119    pub Description: Option<String>,
120    /// Windows user account is disabled.
121    pub Disabled: Option<bool>,
122    /// Name of the Windows domain to which a user account belongs, for example: "NA-SALES".
123    pub Domain: Option<String>,
124    /// Full name of a local user, for example: "Dan Wilson".
125    pub FullName: Option<String>,
126    /// Date the object is installed. This property does not need a value to indicate that the
127    /// object is installed.
128    pub InstallDate: Option<WMIDateTime>,
129    /// If true, the account is defined on the local computer.
130    pub LocalAccount: Option<bool>,
131    /// If true, the user account is locked out of the Windows operating system.
132    pub Lockout: Option<bool>,
133    /// Name of the Windows user account on the domain that the Domain property of this class specifies.
134    ///
135    /// Example: "danwilson".
136    pub Name: Option<String>,
137    /// If true, the password on this user account can be changed.
138    pub PasswordChangeable: Option<bool>,
139    /// If true, the password on this user account expires.
140    pub PasswordExpires: Option<bool>,
141    /// If true, a password is required on a Windows user account. If false, this account does not
142    /// require a password.
143    pub PasswordRequired: Option<bool>,
144    /// Security identifier (SID) for this account.
145    /// A SID is a string value of variable length that is used to identify a trustee.
146    /// Each account has a unique SID that an authority, such as a Windows domain, issues.
147    /// The SID is stored in the security database.
148    /// When a user logs on, the system retrieves the user SID from the database,
149    /// places the SID in the user access token,
150    /// and then uses the SID in the user access token
151    /// to identify the user in all subsequent interactions with Windows security.
152    /// Each SID is a unique identifier for a user or group,
153    /// and a different user or group cannot have the same SID.
154    pub SID: Option<String>,
155    /// Enumerated value that specifies the type of SID.
156    ///
157    /// - SidTypeUser (1)
158    /// - SidTypeGroup (2)
159    /// - SidTypeDomain (3)
160    /// - SidTypeAlias (4)
161    /// - SidTypeWellKnownGroup (5)
162    /// - SidTypeDeletedAccount (6)
163    /// - SidTypeInvalid (7)
164    /// - SidTypeUnknown (8)
165    /// - SidTypeComputer (9)
166    pub SIDType: Option<u8>,
167    /// Current status of an object.
168    /// Various operational and nonoperational statuses can be defined.
169    /// Operational statuses include: "OK", "Degraded", and "Pred Fail",
170    /// which is an element such as a SMART-enabled hard disk drive that may be functioning properly,
171    /// but predicts a failure in the near future.
172    /// Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service",
173    /// which can apply during mirror re-silvering of a disk,
174    /// reloading a user permissions list, or other administrative work.
175    ///
176    /// Values include the following:
177    ///
178    /// - OK ("OK")
179    /// - Error ("Error")
180    /// - Degraded ("Degraded")
181    /// - Unknown ("Unknown")
182    /// - Pred Fail ("Pred Fail")
183    /// - Starting ("Starting")
184    /// - Stopping ("Stopping")
185    /// - Service ("Service")
186    /// - Stressed ("Stressed")
187    /// - NonRecover ("NonRecover")
188    /// - No Contact ("No Contact")
189    /// - Lost Comm ("Lost Comm")
190    pub Status: Option<String>,
191}
192
193/// The `Win32_Account` abstract WMI class contains information about user accounts and group accounts
194/// known to the computer system running Windows.
195/// User or group names recognized by a Windows domain are descendants (or members) of this class.
196///
197/// <https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-account>
198#[derive(Default, Deserialize, Serialize, Debug, Clone)]
199#[allow(non_snake_case)]
200#[allow(non_camel_case_types)]
201pub struct Win32_Account {
202    /// Short description of the object.
203    pub caption: Option<String>,
204    /// Description of the object.
205    pub description: Option<String>,
206    /// Name of the Windows domain to which a group or user belongs.
207    ///
208    /// Example: "NA-SALES"
209    pub domain: Option<String>,
210    /// Date and time that the object was installed. This property does not require a value to
211    /// indicate that the object is installed.
212    pub install_date: Option<WMIDateTime>,
213    /// If TRUE, the account is defined on the local machine. To retrieve only accounts defined on
214    /// the local machine, design a query that includes the condition "LocalAccount=TRUE".
215    pub local_account: Option<bool>,
216    /// Name of the Windows system account on the domain specified by the Domain property of this
217    /// class. This property overrides the Name property inherited from CIM_ManagedSystemElement.
218    pub name: Option<String>,
219    /// Security identifier (SID) for this account.
220    /// A SID is a string value of variable length used to identify a trustee.
221    /// Each account has a unique SID issued by an authority (such as a Windows domain),
222    /// stored in a security database.
223    /// When a user logs on,
224    /// the system retrieves the user's SID from the database and places it in the user's access token.
225    /// The system uses the SID in the user's access token
226    /// to identify the user in all subsequent interactions with Windows security.
227    /// When a SID has been used as the unique identifier for a user or group,
228    /// it cannot be used again to identify another user or group.
229    pub sid: Option<String>,
230    /// Enumerated values that specify the type of security identifier (SID).
231    ///
232    /// - SidTypeUser (1)
233    /// - SidTypeGroup (2)
234    /// - SidTypeDomain (3)
235    /// - SidTypeAlias (4)
236    /// - SidTypeWellKnownGroup (5)
237    /// - SidTypeDeletedAccount (6)
238    /// - SidTypeInvalid (7)
239    /// - SidTypeUnknown (8)
240    /// - SidTypeComputer (9)
241    pub sid_type: Option<u8>,
242    /// Current status of the object.
243    /// Various operational and nonoperational statuses can be defined.
244    /// Operational statuses include: "OK", "Degraded", and "Pred Fail"
245    /// (an element, such as a SMART-enabled hard disk drive,
246    /// may be functioning properly but predicts a failure in the near future).
247    /// Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service".
248    /// The latter, "Service", can apply during mirror-re-silvering of a disk,
249    /// reload of a user permissions list, or other administrative work.
250    /// Not all such work is online,
251    /// yet the managed element is neither "OK" nor in one of the other states.
252    ///
253    /// The values are:
254    ///
255    /// - OK ("OK")
256    /// - Error ("Error")
257    /// - Degraded ("Degraded")
258    /// - Unknown ("Unknown")
259    /// - Pred Fail ("Pred Fail")
260    /// - Starting ("Starting")
261    /// - Stopping ("Stopping")
262    /// - Service ("Service")
263    /// - Stressed ("Stressed")
264    /// - NonRecover ("NonRecover")
265    /// - No Contact ("No Contact")
266    /// - Lost Comm ("Lost Comm")
267    pub status: Option<String>,
268}
269
270/// The `Win32_Group WMI` class represents data about a group account.
271/// A group account allows access privileges to be changed for a list of users.
272/// Example: Marketing2.
273///
274/// <https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-group>
275#[derive(Default, Deserialize, Serialize, Debug, Clone)]
276#[allow(non_snake_case)]
277#[allow(non_camel_case_types)]
278pub struct Win32_Group {
279    /// A short textual description of the object.
280    pub Caption: Option<String>,
281    /// A textual description of the object.
282    pub Description: Option<String>,
283    /// Indicates when the object was installed. Lack of a value does not indicate that the object
284    /// is not installed.
285    pub InstallDate: Option<WMIDateTime>,
286    /// String that indicates the current status of the object.
287    /// Operational and non-operational status can be defined.
288    /// Operational status can include "OK", "Degraded", and "Pred Fail".
289    /// "Pred Fail" indicates that an element is functioning properly,
290    /// but is predicting a failure (for example, a SMART-enabled hard disk drive).
291    ///
292    /// Non-operational status can include "Error", "Starting", "Stopping", and "Service".
293    /// "Service" can apply during disk mirror-re-silvering,
294    /// reloading a user permissions list, or other administrative work.
295    /// Not all such work is online,
296    /// but the managed element is neither "OK" nor in one of the other states.
297    ///
298    /// Values include the following:
299    ///
300    /// - OK ("OK")
301    /// - Error ("Error")
302    /// - Degraded ("Degraded")
303    /// - Unknown ("Unknown")
304    /// - Pred Fail ("Pred Fail")
305    /// - Starting ("Starting")
306    /// - Stopping ("Stopping")
307    /// - Service ("Service")
308    /// - Stressed ("Stressed")
309    /// - NonRecover ("NonRecover")
310    /// - No Contact ("No Contact")
311    /// - Lost Comm ("Lost Comm")
312    pub Status: Option<String>,
313    /// If TRUE, the account is defined on the local machine.
314    /// To retrieve only accounts defined on the local machine,
315    /// design a query that includes the condition "LocalAccount=TRUE".
316    pub LocalAccount: Option<bool>,
317    /// Security identifier (SID) for this account.
318    /// A SID is a string value of variable length used to identify a trustee.
319    /// Each account has a unique SID issued by an authority (such as a Windows domain),
320    /// stored in a security database.
321    /// When a user logs on,
322    /// the system retrieves the user's SID from the database and places it in the user's access token.
323    /// The system uses the SID in the user's access token
324    /// to identify the user in all subsequent interactions with Windows security.
325    /// When a SID has been used as the unique identifier for a user or group,
326    /// it cannot be used again to identify another user or group.
327    pub SID: Option<String>,
328    /// Enumerated values that specify the type of security identifier (SID).
329    ///
330    /// - SidTypeUser (1)
331    /// - SidTypeGroup (2)
332    /// - SidTypeDomain (3)
333    /// - SidTypeAlias (4)
334    /// - SidTypeWellKnownGroup (5)
335    /// - SidTypeDeletedAccount (6)
336    /// - SidTypeInvalid (7)
337    /// - SidTypeUnknown (8)
338    /// - SidTypeComputer (9)
339    pub SIDType: Option<u8>,
340    /// Name of the Windows domain to which the group account belongs.
341    ///
342    /// Example: "NA-SALES"
343    pub Domain: Option<String>,
344    /// Name of the Windows group account on the domain specified by the Domain property of this class.
345    pub Name: Option<String>,
346}
347
348/// The `Win32_LogonSession` WMI class
349/// describes the logon session or sessions associated with a user
350/// logged on to a computer system running Windows.
351///
352/// <https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-logonsession>
353#[derive(Default, Deserialize, Serialize, Debug, Clone)]
354#[allow(non_snake_case)]
355#[allow(non_camel_case_types)]
356pub struct Win32_LogonSession {
357    /// A short textual description of the object.
358    pub Caption: Option<String>,
359    /// A textual description of the object.
360    pub Description: Option<String>,
361    /// Indicates when the object was installed. Lack of a value does not indicate that the object
362    /// is not installed.
363    pub InstallDate: Option<WMIDateTime>,
364    /// Label by which the object is known.
365    /// When subclassed, this property can be overridden to be a key property.
366    pub Name: Option<String>,
367    /// String that indicates the current status of the object.
368    /// Operational and non-operational status can be defined.
369    /// Operational status can include "OK", "Degraded", and "Pred Fail".
370    /// "Pred Fail" indicates that an element is functioning properly,
371    /// but is predicting a failure (for example, a SMART-enabled hard disk drive).
372    ///
373    /// Non-operational status can include "Error", "Starting", "Stopping", and "Service".
374    /// "Service" can apply during disk mirror-re-silvering,
375    /// reloading a user permissions list, or other administrative work.
376    /// Not all such work is online,
377    /// but the managed element is neither "OK" nor in one of the other states.
378    ///
379    /// Values include the following:
380    ///
381    /// - OK ("OK")
382    /// - Error ("Error")
383    /// - Degraded ("Degraded")
384    /// - Unknown ("Unknown")
385    /// - Pred Fail ("Pred Fail")
386    /// - Starting ("Starting")
387    /// - Stopping ("Stopping")
388    /// - Service ("Service")
389    /// - Stressed ("Stressed")
390    /// - NonRecover ("NonRecover")
391    /// - No Contact ("No Contact")
392    /// - Lost Comm ("Lost Comm")
393    pub Status: Option<String>,
394    /// Time at which the session started.
395    pub StartTime: Option<WMIDateTime>,
396    /// Name of the subsystem used to authenticate the logon session.
397    pub AuthenticationPackage: Option<String>,
398    /// ID assigned to the logon session.
399    pub LogonId: Option<String>,
400    /// Numeric value that indicates the type of logon session.
401    ///
402    /// - 0: Used only by the System account.
403    /// - Interactive (2): Intended for users who are interactively using the machine, such as a user being logged on by a terminal server, remote shell, or similar process.
404    /// - Network (3): Intended for high-performance servers to authenticate clear text passwords. LogonUser does not cache credentials for this logon type.
405    /// - Batch (4): Intended for batch servers, where processes can be executed on behalf of a user without their direct intervention; or for higher performance servers that process many clear-text authentication attempts at a time, such as mail or web servers. LogonUser does not cache credentials for this logon type.
406    /// - Service (5): Indicates a service-type logon. The account provided must have the service privilege enabled.
407    /// - Proxy (6): Indicates a proxy-type logon.
408    /// - Unlock (7): This logon type is intended for GINA DLLs logging on users who are interactively using the machine. This logon type allows a unique audit record to be generated that shows when the workstation was unlocked.
409    /// - NetworkCleartext (8): Preserves the name and password in the authentication packages, allowing the server to make connections to other network servers while impersonating the client. This allows a server to accept clear text credentials from a client, call LogonUser, verify that the user can access the system across the network, and still communicate with other servers.
410    /// - NewCredentials (9): Allows the caller to clone its current token and specify new credentials for outbound connections. The new logon session has the same local identify, but uses different credentials for other network connections.
411    /// - RemoteInteractive (10): Terminal Services session that is both remote and interactive.
412    /// - CachedInteractive (11): Attempt cached credentials without accessing the network.
413    /// - CachedRemoteInteractive (12): Same as RemoteInteractive. This is used for internal auditing.
414    /// - CachedUnlock (13): Workstation logon.
415    pub LogonType: Option<u32>,
416}
417
418/// The `Win32_NetworkLoginProfile`
419/// WMI class represents the network login information of a specific user on a computer system running Windows.
420/// This includes, but is not limited to password status,
421/// access privileges, disk quotas, and logon directory paths.
422///
423/// <https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-networkloginprofile>
424#[derive(Default, Deserialize, Serialize, Debug, Clone)]
425#[allow(non_snake_case)]
426#[allow(non_camel_case_types)]
427pub struct Win32_NetworkLoginProfile {
428    /// Short textual description of the current object.
429    pub Caption: Option<String>,
430    /// Textual description of the current object.
431    pub Description: Option<String>,
432    /// Identifier by which the current object is known.
433    pub SettingID: Option<String>,
434    /// Account will expire.
435    /// This value is calculated from the number of seconds elapsed since 00:00:00,
436    /// January 1, 1970, and is set in this format: yyyymmddhhmmss.mmmmmm sutc.
437    ///
438    /// Example: 20521201000230.000000 000
439    pub AccountExpires: Option<WMIDateTime>,
440
441    /// Set of flags that specify the resources a user is authorized to use or modify.
442    ///
443    /// - 1 (0x1): Printer
444    /// - 2 (0x2):  Communication
445    /// - 4 (0x4): Server
446    /// - 8 (0x8): Accounts
447    pub AuthorizationFlags: Option<u32>,
448    /// Number of times the user enters a bad password when logging on to a computer system running Windows.
449    ///
450    /// Example: 0
451    pub BadPasswordCount: Option<u32>,
452    /// Code page for the user's language of choice. A code page is the character set used.
453    pub CodePage: Option<u32>,
454    /// Comment or description for this logon profile.
455    pub Comment: Option<String>,
456    /// Country/region code for the user's language of choice.
457    pub CountryCode: Option<u32>,
458    /// The properties available to this network profile.
459    ///
460    /// Properties that can be set include:
461    ///
462    /// - 1 (0x1): Script: A logon script executed. This value must be set for LAN Manager 2.0.
463    /// - 2 (0x2): Account Disabled: The user's account is disabled.
464    /// - 8 (0x8): Home Directory Required: A home directory is required.
465    /// - 16 (0x10): Lockout: The account is currently locked out. For NetUserSetInfo, this value can be cleared to unlock a previously locked account. This value cannot be used to lock a previously unlocked account.
466    /// - 32 (0x20): Password Not Required: No password is required.
467    /// - 64 (0x40): Password Cannot Change: The user cannot change the password.
468    /// - 128 (0x80): Encrypted Test Password Allowed
469    /// - 256 (0x100): Temp Duplicate Account: An account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. The User Manager refers to this account type as a local user account.
470    /// - 512 (0x200): Normal Account: Default account type that represents a typical user.
471    /// - 2048 (0x800): Interdomain Trust Account: A permit to a trust account for a domain that trusts other domains.
472    /// - 4096 (0x1000): Workstation Trust Account: A computer account for a Windows workstation or server that is a member of this domain.
473    /// - 8192 (0x2000): Server Trust Account: A computer account for a backup domain controller that is a member of this domain.
474    /// - 65536 (0x10000): Do Not Expire Password
475    /// - 131072 (0x20000): MNS Logon Account: Majority Node Set (MNS) logon account type that represents an MNS user.
476    /// - 262144 (0x40000): Smartcard Required
477    /// - 524288 (0x80000): Trusted for Delegation
478    /// - 1048576 (0x100000): Not Delegated
479    /// - 2097152 (0x200000): Use DES Key Only
480    /// - 4194304 (0x400000): Do Not Require Preauthorization
481    /// - 8388608 (0x800000): Password Expired: Indicates that the password has expired.
482    ///
483    /// The following properties describe the account type. Only one value can be set:
484    ///
485    /// - UF_NORMAL_ACCOUNT
486    /// - UF_TEMP_DUPLICATE_ACCOUNT
487    /// - UF_WORKSTATION_TRUST_ACCOUNT
488    /// - UF_SERVER_TRUST_ACCOUNT
489    /// - UF_INTERDOMAIN_TRUST_ACCOUNT
490    pub Flags: Option<u32>,
491    /// Full name of the user belonging to the network login profile.
492    /// This string can be empty if the user chooses not to associate a full name with a user name.
493    pub FullName: Option<String>,
494    /// Path to the home directory of the user. This string may be empty if the user chooses not to
495    /// specify a home directory.
496    ///
497    /// Example:"\HOMEDIR"
498    pub HomeDirectory: Option<String>,
499    /// Drive letter assigned to the user's home directory for log on purposes.
500    ///
501    /// Example: "C:"
502    pub HomeDirectoryDrive: Option<String>,
503    /// User last logged off the system. This value is calculated from the number of seconds elapsed
504    /// since 00:00:00, January 1, 1970. A value of " **************.******+*** " means that the
505    /// last logoff time is unknown. The format of this value is yyyymmddhhmmss.mmmmmm sutc. For
506    /// information about translating this property into your local time, see WMI Tasks: Dates and
507    /// Times.
508    ///
509    /// Example: 19521201000230.000000 000
510    ///
511    /// Note: Should be of type WMIDateTime but causes parsing errors due to starting with zeroes.
512    pub LastLogoff: Option<String>,
513    /// User last logged on to the system.
514    /// This value is calculated from the number of seconds elapsed since 00:00:00,
515    /// January 1, 1970. The format of this value is yyyymmddhhmmss.mmmmmm sutc.
516    /// For information about translating this property into your local time, see WMI Tasks:
517    /// Dates and Times.
518    ///
519    /// Example: 19521201000230.000000 000
520    pub LastLogon: Option<WMIDateTime>,
521    /// Times during the week when the user can log on.
522    /// Each bit represents a unit of time specified by the UnitsPerWeek property.
523    /// For instance, if the unit of time is hourly, the first bit (bit 0, word 0) is Sunday,
524    /// 0:00 to 0:59, the second bit (bit 1, word 0) is Sunday, 1:00 to 1:59, and so on.
525    /// If this member is set to NULL, then there is no time restriction.
526    /// The time is set to GMT and must be adjusted for other time zones
527    /// (for example, GMT minus 8 hours for PST).
528    pub LogonHours: Option<String>,
529    /// Name of the server to which logon requests are sent.
530    /// Server names should be preceded by two backslashes (\\).
531    /// A server name with an asterisk (\\*)
532    /// indicates that the logon request can be handled by any logon server.
533    /// A null string indicates that requests are sent to the domain controller.
534    ///
535    /// Example: "\\MyServer"
536    pub LogonServer: Option<String>,
537    /// Maximum amount of disk space available to the user.
538    /// If MaximumStorage is set to USER_MAXSTORAGE_UNLIMITED,
539    /// the user is allowed to use all of the available disk space.
540    ///
541    /// Example: 10000000
542    pub MaximumStorage: Option<u64>,
543    /// User account on a particular domain or computer.
544    /// The number of characters in the name cannot exceed the value of UNLEN.
545    ///
546    /// Example: "somedomain\johndoe"
547    pub Name: Option<String>,
548    /// Number of successful times the user tried to log on to this account.
549    /// A value of 0xFFFFFFFF indicates that the value is unknown.
550    /// This property is maintained separately on each backup domain controller (BDC) in the domain.
551    /// To get an accurate value, only the largest value from all BDCs should be used.
552    ///
553    /// Example: 4
554    pub NumberOfLogons: Option<u32>,
555    /// Space set aside for use by applications.
556    /// This string can be null,
557    /// or it can have any number of characters before the terminating null character.
558    /// Microsoft products use this member to store user configuration information.
559    /// Do not modify this information, because this value is specific to an application.
560    pub Parameters: Option<String>,
561    /// Length of time a password has been in effect.
562    /// This value is measured from the number of seconds elapsed since the password was last changed.
563    ///
564    /// Example: 00001201000230.000000 000
565    ///
566    /// Note: Should be of type WMIDateTime but causes parsing errors due to starting with zeroes.
567    pub PasswordAge: Option<String>,
568    /// Date and time the password expires.
569    /// The value is set in this format: yyyymmddhhmmss.mmmmmm sutc
570    ///
571    /// Example: 19521201000230.000000 000
572    pub PasswordExpires: Option<WMIDateTime>,
573    /// Relative identifier (RID) of the Primary Global Group for this user.
574    /// The identifier verifies the primary group to which the user's profile belongs.
575    pub PrimaryGroupId: Option<u32>,
576    /// Level of privilege assigned to the usri3_name property.
577    ///
578    /// - Guest (0)
579    /// - User (1)
580    /// - Administrator (2)
581    pub Privileges: Option<u32>,
582    /// Path to the user's profile.
583    /// This value can be a null string, a local absolute path, or a UNC path.
584    /// A user profile contains settings that are customizable for each user such as the desktop colors.
585    ///
586    /// Example: "C:\Windows"
587    pub Profile: Option<String>,
588    /// Directory path to the user's logon script.
589    /// A logon script automatically executes a set of commands each time a user logs on to a system.
590    ///
591    /// Example: "C:\win\profiles\ThomasSteven"
592    pub ScriptPath: Option<String>,
593    /// Number of time units the week is divided into.
594    /// It is used with the LogonHours property to limit user access to the computer.
595    ///
596    /// Example: 168 (hours per week)
597    pub UnitsPerWeek: Option<u32>,
598    /// User-defined comment or description for this profile.
599    pub UserComment: Option<String>,
600    /// RID of the user. The identifier verifies that the user exists and is unique to this domain.
601    pub UserId: Option<u32>,
602    /// Type of account to which the user has privileges.
603    ///
604    /// The values are:
605    ///
606    /// - Normal Account ("Normal Account")
607    /// - Duplicate Account ("Duplicate Account")
608    /// - Workstation Trust Account ("Workstation Trust Account")
609    /// - Server Trust Account ("Server Trust Account")
610    /// - Interdomain Trust Account ("Interdomain Trust Account")
611    /// - Unknown ("Unknown")
612    pub UserType: Option<String>,
613    /// Names of workstations from which the user can log on.
614    /// Up to eight workstations can be specified; the names must be separated by commas (,).
615    /// A null string indicates no restrictions.
616    /// To disable logons from all workstations to this account,
617    /// set the UF_ACCOUNTDISABLE in the Flags property of this class.
618    pub Workstations: Option<String>,
619}
620
621/// The `Win32_SystemAccount` WMI class represents a system account.
622/// The system account is used by the operating system and services.
623/// There are many services and processes within Windows that need the capability to logon internally,
624/// for example, during a Windows installation.
625/// The system account was designed for that purpose.
626///
627/// The system account is an internal account that does not show up in User Manager,
628/// cannot be added to any groups, and cannot have user rights assigned to it.
629/// However, the system account does show up on an NTFS file system volume in file manager,
630/// which is located in the Permissions section of the Security menu.
631/// By default, the system account is granted full control to all files on an NTFS file system volume,
632/// which means
633/// that the system account has the same functional privileges as the administrator account.
634///
635/// <https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-systemaccount>
636#[derive(Default, Deserialize, Serialize, Debug, Clone)]
637#[allow(non_snake_case)]
638#[allow(non_camel_case_types)]
639pub struct Win32_SystemAccount {
640    /// A short textual description of the object.
641    pub Caption: Option<String>,
642    /// A textual description of the object.
643    pub Description: Option<String>,
644    /// Indicates when the object was installed.
645    /// Lack of a value does not indicate that the object is not installed.
646    pub InstallDate: Option<WMIDateTime>,
647    /// String that indicates the current status of the object.
648    /// Operational and non-operational status can be defined.
649    /// Operational status can include "OK", "Degraded", and "Pred Fail".
650    /// "Pred Fail" indicates that an element is functioning properly,
651    /// but is predicting a failure (for example, a SMART-enabled hard disk drive).
652    ///
653    /// Non-operational status can include "Error", "Starting", "Stopping", and "Service".
654    /// "Service" can apply during disk mirror-re-silvering,
655    /// reloading a user permissions list, or other administrative work.
656    /// Not all such work is online,
657    /// but the managed element is neither "OK" nor in one of the other states.
658    ///
659    /// Values include the following:
660    ///
661    /// - OK ("OK")
662    /// - Error ("Error")
663    /// - Degraded ("Degraded")
664    /// - Unknown ("Unknown")
665    /// - Pred Fail ("Pred Fail")
666    /// - Starting ("Starting")
667    /// - Stopping ("Stopping")
668    /// - Service ("Service")
669    /// - Stressed ("Stressed")
670    /// - NonRecover ("NonRecover")
671    /// - No Contact ("No Contact")
672    /// - Lost Comm ("Lost Comm")
673    pub Status: Option<String>,
674    /// If TRUE, the account is defined on the local machine.
675    /// To retrieve only accounts defined on the local machine,
676    /// design a query that includes the condition "LocalAccount=TRUE".
677    pub LocalAccount: Option<bool>,
678    /// Security identifier (SID) for this account.
679    /// A SID is a string value of variable length used to identify a trustee.
680    /// Each account has a unique SID issued by an authority (such as a Windows domain),
681    /// stored in a security database.
682    /// When a user logs on,
683    /// the system retrieves the user's SID from the database and places it in the user's access token.
684    /// The system uses the SID in the user's access token
685    /// to identify the user in all subsequent interactions with Windows security.
686    /// When a SID has been used as the unique identifier for a user or group,
687    /// it cannot be used again to identify another user or group.
688    pub SID: Option<String>,
689    /// Enumerated values that specify the type of security identifier (SID).
690    ///
691    /// - SidTypeUser (1)
692    /// - SidTypeGroup (2)
693    /// - SidTypeDomain (3)
694    /// - SidTypeAlias (4)
695    /// - SidTypeWellKnownGroup (5)
696    /// - SidTypeDeletedAccount (6)
697    /// - SidTypeInvalid (7)
698    /// - SidTypeUnknown (8)
699    /// - SidTypeComputer (9)
700    pub SIDType: Option<u8>,
701    /// Name of the Windows domain to which the system account belongs.
702    ///
703    /// Example: "NA-SALES"
704    pub Domain: Option<String>,
705    /// Name of the Windows system account on the domain specified by the Domain property of this class.
706    pub Name: Option<String>,
707}