Documentation ¶
Index ¶
- Variables
- type Computer
- type Config
- type FullUser
- type Group
- type LDAP
- func (l *LDAP) AddUserToGroup(dn, groupDN string) error
- func (l *LDAP) ChangePasswordForSAMAccountName(sAMAccountName, oldPassword, newPassword string) (err error)
- func (l *LDAP) CheckPasswordForDN(dn, password string) (*User, error)
- func (l *LDAP) CheckPasswordForSAMAccountName(sAMAccountName, password string) (*User, error)
- func (l *LDAP) CreateUser(user FullUser, password string) (string, error)
- func (l *LDAP) DeleteUser(dn string) error
- func (l *LDAP) FindComputerByDN(dn string) (computer *Computer, err error)
- func (l *LDAP) FindComputerBySAMAccountName(sAMAccountName string) (computer *Computer, err error)
- func (l *LDAP) FindComputers() (computers []Computer, err error)
- func (l *LDAP) FindGroupByDN(dn string) (group *Group, err error)
- func (l *LDAP) FindGroups() (groups []Group, err error)
- func (l *LDAP) FindUserByDN(dn string) (user *User, err error)
- func (l *LDAP) FindUserByMail(mail string) (user *User, err error)
- func (l *LDAP) FindUserBySAMAccountName(sAMAccountName string) (user *User, err error)
- func (l *LDAP) FindUsers() (users []User, err error)
- func (l LDAP) GetConnection() (*ldap.Conn, error)
- func (l *LDAP) RemoveUserFromGroup(dn, groupDN string) error
- func (l *LDAP) WithCredentials(dn, password string) (*LDAP, error)
- type Object
- type SamAccountType
- type UAC
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New("user not found") ErrSAMAccountNameDuplicated = errors.New("sAMAccountName is not unique") ErrMailDuplicated = errors.New("mail is not unique") )
View Source
var (
ErrActiveDirectoryMustBeLDAPS = errors.New("ActiveDirectory servers must be connected to via LDAPS to change passwords")
)
View Source
var ErrComputerNotFound = errors.New("computer not found")
View Source
var ErrDNDuplicated = errors.New("DN is not unique")
View Source
var ErrGroupNotFound = errors.New("group not found")
Functions ¶
This section is empty.
Types ¶
type FullUser ¶
type FullUser struct { CN string SAMAccountName *string FirstName string LastName string DisplayName *string Description *string Email *string ObjectClasses []string // AccountExpires represents the expiration date of the user's account. // When set to nil, the account never expires. AccountExpires *time.Time UserAccountControl UAC Path *string }
type LDAP ¶
type LDAP struct {
// contains filtered or unexported fields
}
func (*LDAP) AddUserToGroup ¶
func (*LDAP) ChangePasswordForSAMAccountName ¶
func (*LDAP) CheckPasswordForDN ¶
func (*LDAP) CheckPasswordForSAMAccountName ¶
func (*LDAP) DeleteUser ¶
func (*LDAP) FindComputerByDN ¶
func (*LDAP) FindComputerBySAMAccountName ¶
func (*LDAP) FindComputers ¶
func (*LDAP) FindGroups ¶
func (*LDAP) FindUserBySAMAccountName ¶
func (LDAP) GetConnection ¶
func (*LDAP) RemoveUserFromGroup ¶
type SamAccountType ¶
type SamAccountType uint32
SamAccountType is a bit mask that defines the type of an account. https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccounttype
const ( SamDomainObject SamAccountType = 0x0 SamGroupObject SamAccountType = 0x10000000 SamNonSecurityGroupObject SamAccountType = 0x10000001 SamAliasObject SamAccountType = 0x20000000 SamNonSecurityAliasObject SamAccountType = 0x20000001 // SamUserObject is also known as SAM_NORMAL_USER_ACCOUNT SamUserObject SamAccountType = 0x30000000 SamMachineAccount SamAccountType = 0x30000001 SamTrustAccount SamAccountType = 0x30000002 SamAppBasicGroup SamAccountType = 0x40000000 SamAppQueryGroup SamAccountType = 0x40000001 SamAccountTypeMax SamAccountType = 0x7fffffff )
func (SamAccountType) String ¶
func (t SamAccountType) String() string
type UAC ¶
type UAC struct { LogonScript bool AccountDisabled bool HomeDirRequired bool Lockout bool PasswordNotRequired bool PasswordCantChange bool EncryptedTextPasswordAllowed bool TempDuplicateAccount bool NormalAccount bool InterdomainTrustAccount bool WorkstationTrustAccount bool ServerTrustAccount bool NoPasswordExpiration bool MNSLogonAccount bool SmartCardRequired bool TrustedForDelegation bool NotDelegated bool UseDESKeyOnly bool DontRequirePreauth bool PasswordExpired bool TrustedToAuthenticateForDelegation bool }
UAC represents the User Account Control flags for a user. https://learn.microsoft.com/en-us/windows/win32/adschema/a-useraccountcontrol
func UACFromUint32 ¶
Click to show internal directories.
Click to hide internal directories.