windowslocal

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package windowslocal provides read-only access to local Windows SAM users.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("local SAM account not found")

Functions

func Unavailable

func Unavailable(a Account) (bool, error)

Unavailable rejects disabled, locked, and expired local SAM accounts.

func ValidatePassword

func ValidatePassword(a Account, password string) (valid bool, retErr error)

ValidatePassword authenticates against the local SAM, without S4U or a persistent credential. An ordinary logon rejection returns false, nil.

Types

type Account

type Account struct {
	Name string
	SID  string
}

Account identifies a local SAM user. Callers must retain both fields when passing an account to Disabled or ValidatePassword.

func Lookup

func Lookup(name string) (Account, error)

Lookup resolves a bare name against this machine's SAM only.

func LookupBySID

func LookupBySID(value string) (Account, error)

LookupBySID accepts only a SID that resolves back to the local SAM user.

func (Account) GetField

func (a Account) GetField(name string) (any, bool, error)

GetField implements the template context for a local account. Group data includes direct local and BUILTIN aliases, not domain or nested membership.

Jump to

Keyboard shortcuts

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