Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than netapi32, prefix the name with the module name and a period.
USER_INFO_2 (netapi32)
.
C# Signature:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
unsafe struct USER_INFO_2
{
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_name;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_password;
public uint usri2_password_age;
public uint usri2_priv;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_home_dir;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_comment;
public uint usri2_flags;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_script_path;
public uint usri2_auth_flags;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_full_name;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_usr_comment;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_parms;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_workstations;
public uint usri2_last_logon;
public uint usri2_last_logoff;
public uint usri2_acct_expires;
public uint usri2_max_storage;
public uint usri2_units_per_week;
public byte* usri2_logon_hours;
public uint usri2_bad_pw_count;
public uint usri2_num_logons;
[MarshalAs(UnmanagedType.LPWStr)] public string usri2_logon_server;
public uint usri2_country_code;
public uint usri2_code_page;
}
VB.NET Signature:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Structure USER_INFO_2
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_name As String
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_password As String
Public usri2_password_age As UInteger
Public usri2_priv As UInteger
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_home_dir As String
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_comment As String
Public usri2_flags As UInteger
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_script_path As String
Public usri2_auth_flags As UInteger
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_full_name As String
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_usr_comment As String
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_parms As String
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_workstations As String
Public usri2_last_logon As UInteger
Public usri2_last_logoff As UInteger
Public usri2_acct_expires As UInteger
Public usri2_max_storage As UInteger
Public usri2_units_per_week As UInteger
Public usri2_logon_hours As IntPtr
Public usri2_bad_pw_count As UInteger
Public usri2_num_logons As UInteger
<MarshalAs(UnmanagedType.LPWStr)>
Public usri2_logon_server As String
Public usri2_country_code As UInteger
Public usri2_code_page As UInteger
End Structure
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USER_INFO_2
{
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_name;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_password;
public int usri2_password_age;
public int usri2_priv;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_home_dir;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_comment;
public uint usri2_flags;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_script_path;
public uint usri2_auth_flags;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_full_name;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_usr_comment;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_parms;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_workstations;
public uint usri2_last_logon;
public uint usri2_last_logoff;
public uint usri2_acct_expires;
public int usri2_max_storage;
public int usri2_units_per_week;
IntPtr usri2_logon_hours;
public uint usri2_bad_pw_count;
public uint usri2_num_logons;
[MarshalAs(UnmanagedType.LPWStr)]
public string usri2_logon_server;
public int usri2_country_code;
public int usri2_code_page;
}
VB Signature:
Declare Function USER_INFO_2 Lib "netapi32.dll" (TODO) As TODO
User-Defined Types:
None.
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
Please add some!
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).