netapi32

package
v0.0.0-...-f8dbd7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//User filters
	USER_FILTER_TEMP_DUPLICATE_ACCOUNT    = 0x0001
	USER_FILTER_NORMAL_ACCOUNT            = 0x0002
	USER_FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008
	USER_FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010
	USER_FILTER_SERVER_TRUST_ACCOUNT      = 0x0020
	USER_MAX_PREFERRED_LENGTH             = 0xFFFFFFFF
)
View Source
const (
	NET_API_STATUS_NERR_Success                      = 0
	NET_API_STATUS_NERR_InvalidComputer              = 2351
	NET_API_STATUS_NERR_NotPrimary                   = 2226
	NET_API_STATUS_NERR_SpeGroupOp                   = 2234
	NET_API_STATUS_NERR_LastAdmin                    = 2452
	NET_API_STATUS_NERR_BadPassword                  = 2203
	NET_API_STATUS_NERR_PasswordTooShort             = 2245
	NET_API_STATUS_NERR_UserNotFound                 = 2221
	NET_API_STATUS_ERROR_ACCESS_DENIED               = 5
	NET_API_STATUS_ERROR_NOT_ENOUGH_MEMORY           = 8
	NET_API_STATUS_ERROR_INVALID_PARAMETER           = 87
	NET_API_STATUS_ERROR_INVALID_NAME                = 123
	NET_API_STATUS_ERROR_INVALID_LEVEL               = 124
	NET_API_STATUS_ERROR_MORE_DATA                   = 234
	NET_API_STATUS_ERROR_SESSION_CREDENTIAL_CONFLICT = 1219
	NET_API_STATUS_RPC_S_SERVER_UNAVAILABLE          = 2147944122
	NET_API_STATUS_RPC_E_REMOTE_DISABLED             = 2147549468

	USER_PRIV_MASK = 0x3

	//User priveledge level
	USER_PRIV_GUEST = 0
	USER_PRIV_USER  = 1
	USER_PRIV_ADMIN = 2
)

Variables

View Source
var (
	ACCOUNT_CONTROL_FLAGS = map[int64]string{
		0x0001:    "UF_SCRIPT",
		0x0002:    "UF_ACCOUNTDISABLE",
		0x0008:    "UF_HOMEDIR_REQUIRED",
		0x0020:    "UF_PASSWD_NOTREQD",
		0x0040:    "UF_PASSWD_CANT_CHANGE",
		0x0010:    "UF_LOCKOUT",
		0x10000:   "UF_DONT_EXPIRE_PASSWD",
		0x0080:    "UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED",
		0x100000:  "UF_NOT_DELEGATED",
		0x40000:   "UF_SMARTCARD_REQUIRED",
		0x200000:  "UF_USE_DES_KEY_ONLY",
		0x400000:  "UF_DONT_REQUIRE_PREAUTH",
		0x80000:   "UF_TRUSTED_FOR_DELEGATION",
		0x800000:  "UF_PASSWORD_EXPIRED",
		0x1000000: "UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION",
	}
)

Functions

func UTF16toString

func UTF16toString(p *uint16) string

UTF16toString converts a pointer to a UTF16 string into a Go string.

Types

type LocalUser1

type LocalUser1 struct {
	Username      string
	PasswordAge   time.Duration
	Privilege     string
	HomeDirectory string
	Comment       string
	Flags         []string
	ScriptPath    string
}

func ListLocalUsers

func ListLocalUsers(serverName string, level int64, access uint32) ([]LocalUser1, error)

ListLocalUsers lists information about local user accounts.

type USER_INFO_1

type USER_INFO_1 struct {
	// contains filtered or unexported fields
}

type USER_INFO_2

type USER_INFO_2 struct {
	Usri2_name           *uint16
	Usri2_password       *uint16
	Usri2_password_age   uint32
	Usri2_priv           uint32
	Usri2_home_dir       *uint16
	Usri2_comment        *uint16
	Usri2_flags          uint32
	Usri2_script_path    *uint16
	Usri2_auth_flags     uint32
	Usri2_full_name      *uint16
	Usri2_usr_comment    *uint16
	Usri2_parms          *uint16
	Usri2_workstations   *uint16
	Usri2_last_logon     uint32
	Usri2_last_logoff    uint32
	Usri2_acct_expires   uint32
	Usri2_max_storage    uint32
	Usri2_units_per_week uint32
	Usri2_logon_hours    uintptr
	Usri2_bad_pw_count   uint32
	Usri2_num_logons     uint32
	Usri2_logon_server   *uint16
	Usri2_country_code   uint32
	Usri2_code_page      uint32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL