Active_directory
Explore the following sections to learn more:
active_directory
import "github.com/gemini-oss/rego/pkg/active_directory"
pkg/active_directory/active_directory.go
pkg/active_directory/entities.go
pkg/active_directory/groups.go
pkg/active_directory/query.go
pkg/active_directory/users.go
Index
- Constants
- Variables
- func ConvertAttributes(attributes *[]Attribute) []string
- type Attribute
- type Client
- func NewClient(verbosity int) *Client
- func (c *Client) ActiveUsers() (*Users, error)
- func (c *Client) BuildDN(endpoint string, identifiers …interface{}) string
- func (c *Client) DisabledUsers() (*Users, error)
- func (c *Client) GetCache(key string, target interface{}) bool
- func (c *Client) ListAllAdmins() (*Users, error)
- func (c *Client) ListAllGroups() (*Groups, error)
- func (c *Client) ListAllUsers() (*Users, error)
- func (c *Client) MemberOf(group string) (*Users, error)
- func (c *Client) PasswordNeverExpiresUsers() (*Users, error)
- func (c *Client) SetCache(key string, value interface{}, duration time.Duration)
- type Computer
- type Computers
- type Filter
- type Group
- type Groups
- type LDAPObjectClass
- type LDAPQuery
- func NewLDAPQuery(baseDN, filter string, attributes []string) *LDAPQuery
- func (q *LDAPQuery) IsEmpty() bool
- func (q *LDAPQuery) SetAttributes(attrs []string) *LDAPQuery
- func (q *LDAPQuery) SetBaseDN(baseDN string) *LDAPQuery
- func (q *LDAPQuery) SetDerefAliases(deref int) *LDAPQuery
- func (q *LDAPQuery) SetFilter(filter string) *LDAPQuery
- func (q *LDAPQuery) SetPagingSize(size uint32) *LDAPQuery
- func (q *LDAPQuery) SetScope(scope int) *LDAPQuery
- func (q *LDAPQuery) SetSizeLimit(limit int) *LDAPQuery
- func (q *LDAPQuery) SetTimeLimit(limit int) *LDAPQuery
- func (q *LDAPQuery) SetTypesOnly(typesOnly bool) *LDAPQuery
- func (q *LDAPQuery) Validate() error
- type OUs
- type OrganizationalUnit
- type Slice
- type User
- type Users
Constants
const (
LDAPPort = "389" // Default LDAP port for pure TCP connection
LDAPSPort = "636" // Default LDAPS port for SSL connection
)
const (
LDAP_MATCHING_RULE_BIT_AND = "1.2.840.113556.1.4.803" // A match is found only if all bits from the attribute match the value. This rule is equivalent to a bitwise AND operator.
LDAP_MATCHING_RULE_BIT_OR = "1.2.840.113556.1.4.804" // A match is found if any bits from the attribute match the value. This rule is equivalent to a bitwise OR operator.
LDAP_MATCHING_RULE_IN_CHAIN = "1.2.840.113556.1.4.1941" // This rule is limited to filters that apply to the DN. This is a special "extended" match operator that walks the chain of ancestry in objects all the way to the root until it finds a match.
FILTER_USER_ACTIVE = "(&(objectCategory=person)(objectClass=user)(!userAccountControl:" + LDAP_MATCHING_RULE_BIT_AND + ":=2))" // List all active users
FILTER_USER_ADMIN = "(&(objectClass=user)(objectCategory=Person)(adminCount=1))" // List all users in privileged groups [Domain Admins, Enterprise Admins, etc.]
FILTER_USER_DISABLED = "(&(objectCategory=person)(objectClass=user)(useraccountcontrol:" + LDAP_MATCHING_RULE_BIT_AND + ":=16))" // List all disabled users
FILTER_USER_NESTED_GROUP = "(&(objectClass=user)(memberOf:" + LDAP_MATCHING_RULE_IN_CHAIN + ":=CN=%s,%s,%s))" // To Do: Implement better DN handling
FILTER_USER_LOCKED = "(&(objectCategory=person)(objectClass=user)(useraccountcontrol:" + LDAP_MATCHING_RULE_BIT_AND + ":=16))" // List all locked users
FILTER_USER_PASSWORD_NEVER_EXPIRES = "(&(objectCategory=person)(objectClass=user)(useraccountcontrol:" + LDAP_MATCHING_RULE_BIT_AND + ":=65536))" // List all users with passwords that never expire
)
Variables
var (
DefaultUserAttributes = &[]Attribute{
AccountExpires, AdminCount, AltSecurityIdentities,
BadPasswordTime, BadPwdCount,
City, CodePage, CommonName, Country, CountryCode,
Department, DistinguishedName, DSCorePropagationData, DisplayName, Division,
EmployeeID, EmployeeNumber,
GivenName,
InstanceType,
LastLogoff, LastLogon, LastLogonTimestamp,
Manager, Mail, MemberOf, Mobile,
Name,
ObjectCategory, ObjectClass, ObjectGUID, ObjectSID,
PhysicalDeliveryOfficeName, PostalCode, PwdLastSet,
ReplPropertyMetaData,
SAMAccountName, SAMAccountType, SN, StreetAddress,
TelephoneNumber, Title,
UserAccountControl, UserPrincipalName, USNChanged, USNCreated,
WhenChanged, WhenCreated,
}
MinimalUserAttributes = &[]Attribute{
AltSecurityIdentities,
CommonName,
DisplayName, DistinguishedName,
LastLogoff, LastLogon, LastLogonTimestamp,
MemberOf,
Name,
ObjectClass,
SAMAccountName,
UserAccountControl,
}
)
func ConvertAttributes
func ConvertAttributes(attributes *[]Attribute) []string
type Attribute
Attribute holds possible LDAP attribute constants
type Attribute string
const (
CommonName Attribute = "cn" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-cn
Description Attribute = "description" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-description
DN Attribute = "dn" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-distinguishedName
DisplayName Attribute = "displayName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-displayname
DistinguishedName Attribute = "distinguishedName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-distinguishedName
LastLogon Attribute = "lastLogon" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-lastlogon
LastLogonTimestamp Attribute = "lastLogonTimestamp" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-lastlogontimestamp
ObjectCategory Attribute = "objectCategory" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectcategory
ObjectClass Attribute = "objectClass" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectclass
ObjectGUID Attribute = "objectGUID" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectguid
ObjectSID Attribute = "objectSid" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectsid
WhenChanged Attribute = "whenChanged" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-whenchanged
WhenCreated Attribute = "whenCreated" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-whencreated
)
const (
DNSHostName Attribute = "dNSHostName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-dnshostname
OperatingSystem Attribute = "operatingSystem" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-operatingsystem
OperatingSystemServicePack Attribute = "operatingSystemServicePack" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-operatingsystemservicepack
OperatingSystemVersion Attribute = "operatingSystemVersion" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-operatingsystemversion
ServicePrincipalName Attribute = "servicePrincipalName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-serviceprincipalname
)
const (
GroupMember Attribute = "member" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-member
GroupType Attribute = "groupType" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-grouptype
ManagedBy Attribute = "managedBy" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-managedby
)
Organizational Unit attributes
const (
OrganizationName Attribute = "o" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-o
OU Attribute = "ou" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-ou
)
const (
AccountExpires Attribute = "accountExpires" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-accountexpires
AdminCount Attribute = "adminCount" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-admincount
AltSecurityIdentities Attribute = "altSecurityIdentities" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-altsecurityidentities
BadPasswordTime Attribute = "badPasswordTime" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-badpasswordtime
BadPwdCount Attribute = "badPwdCount" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-badpwdcount
City Attribute = "l" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-l
CodePage Attribute = "codePage" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-codepage
Country Attribute = "c" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-c
CountryCode Attribute = "countryCode" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-countrycode
Department Attribute = "department" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-department
DSCorePropagationData Attribute = "dSCorePropagationData" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-dscorepropagationdata
Division Attribute = "division" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-division
EmployeeID Attribute = "employeeID" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-employeeid
EmployeeNumber Attribute = "employeeNumber" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-employeenumber
GivenName Attribute = "givenName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-givenname
InstanceType Attribute = "instanceType" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-instancetype
LastLogoff Attribute = "lastLogoff" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-lastlogoff
Mail Attribute = "mail" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-mail
Manager Attribute = "manager" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-manager
MemberOf Attribute = "memberOf" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-memberof
Mobile Attribute = "mobile" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-mobile
Name Attribute = "name" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-name
PhysicalDeliveryOfficeName Attribute = "physicalDeliveryOfficeName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-physicaldeliveryofficename
PostalCode Attribute = "postalCode" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-postalcode
PwdLastSet Attribute = "pwdLastSet" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-pwdlastset
ReplPropertyMetaData Attribute = "replPropertyMetaData" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-replpropertymetadata
SAMAccountName Attribute = "sAMAccountName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccountname
SAMAccountType Attribute = "sAMAccountType" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccounttype
SN Attribute = "sn" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-sn
State Attribute = "st" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-st
StreetAddress Attribute = "streetAddress" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-streetaddress
TelephoneNumber Attribute = "telephoneNumber" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-telephonenumber
Title Attribute = "title" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-title
UserAccountControl Attribute = "userAccountControl" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-useraccountcontrol
UserPrincipalName Attribute = "userPrincipalName" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-userprincipalname
USNChanged Attribute = "uSNChanged" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-usnchanged
USNCreated Attribute = "uSNCreated" // https://learn.microsoft.com/en-us/windows/win32/adschema/a-usncreated
)
type Client
### Active Directory Client Entities --------------------------------------------------------------------- Client holds Active Directory client data
type Client struct {
Server string
BaseDN string
LDAP *ldap.Conn
Log *log.Logger
Cache *cache.Cache
// contains filtered or unexported fields
}
func NewClient
func NewClient(verbosity int) *Client
- # Generate {Active Directory,LDAP} Client
- @param logger *log.Logger
- @return *Client
- Example:
```go
a := active_directory.NewClient(log.DEBUG)
```
func (*Client) ActiveUsers
func (c *Client) ActiveUsers() (*Users, error)
ActiveUsers retrieves all active users from Active Directory
func (*Client) BuildDN
func (c *Client) BuildDN(endpoint string, identifiers ...interface{}) string
BuildURL builds a URL for a given resource and identifiers. TODO: This is not correct
func (*Client) DisabledUsers
func (c *Client) DisabledUsers() (*Users, error)
DisabledUsers retrieves all disabled users from Active Directory
func (*Client) GetCache
func (c *Client) GetCache(key string, target interface{}) bool
* GetCache retrieves an Active Directory response from the cache
func (*Client) ListAllAdmins
func (c *Client) ListAllAdmins() (*Users, error)
ListAllAdmins retrieves all admins from Active Directory
func (*Client) ListAllGroups
func (c *Client) ListAllGroups() (*Groups, error)
ListAllGroups retrieves all groups from Active Directory
func (*Client) ListAllUsers
func (c *Client) ListAllUsers() (*Users, error)
ListAllUsers retrieves all users from Active Directory
func (*Client) MemberOf
func (c *Client) MemberOf(group string) (*Users, error)
func (*Client) PasswordNeverExpiresUsers
func (c *Client) PasswordNeverExpiresUsers() (*Users, error)
PasswordNeverExpiresUsers retrieves all users with passwords that never expire from Active Directory
func (*Client) SetCache
func (c *Client) SetCache(key string, value interface{}, duration time.Duration)
* SetCache stores an Active Directory response in the cache
type Computer
Computer represents an AD computer account
type Computer struct {
DN string `ldap:"dn,omitempty"`
CommonName string `ldap:"cn,omitempty"`
SAMAccountName string `ldap:"sAMAccountName,omitempty"`
DistinguishedName string `ldap:"distinguishedName,omitempty"`
OperatingSystem string `ldap:"operatingSystem,omitempty"`
WhenCreated time.Time `ldap:"whenCreated,omitempty"`
WhenChanged time.Time `ldap:"whenChanged,omitempty"`
}
type Computers
type Computers []*Computer
type Filter
type Filter struct {
ObjectCategory string
ObjectClass string
MemberOf string
}
type Group
type Group struct {
DN string `ldap:"dn,omitempty"`
CommonName string `ldap:"commonName,omitempty"`
Description string `ldap:"description,omitempty"`
Members []string `ldap:"members,omitempty"`
ManagedBy string `ldap:"managedBy,omitempty"`
WhenCreated time.Time `ldap:"whenCreated,omitempty"`
WhenChanged time.Time `ldap:"whenChanged,omitempty"`
}
type Groups
type Groups []*Group
type LDAPObjectClass
LDAPObjectClass holds possible LDAP object class constants
type LDAPObjectClass string
Enum values for LDAP object classes
const (
ObjectClassUser LDAPObjectClass = "user"
ObjectClassGroup LDAPObjectClass = "group"
ObjectClassPerson LDAPObjectClass = "person"
)
type LDAPQuery
LDAPQuery holds parameters for LDAP searches
type LDAPQuery struct {
BaseDN string // Base Distinguished Name for the search
Filter string // LDAP search filter
Attributes []string // Attributes to be retrieved
Scope int // Scope of the search (Base, SingleLevel, WholeSubtree)
DerefAliases int // Behavior regarding alias dereferencing
SizeLimit int // Maximum number of entries to be returned
TimeLimit int // Time limit (in seconds) for the search
TypesOnly bool // Return attribute types only, not values
Controls []ldap.Control // Request controls for additional features/behaviors
PagingSize uint32 // Size of the paging to be used if any
// contains filtered or unexported fields
}
func NewLDAPQuery
func NewLDAPQuery(baseDN, filter string, attributes []string) *LDAPQuery
NewLDAPQuery creates a default LDAPQuery with common settings
func (*LDAPQuery) IsEmpty
func (q *LDAPQuery) IsEmpty() bool
IsEmpty checks if the query parameters are empty
func (*LDAPQuery) SetAttributes
func (q *LDAPQuery) SetAttributes(attrs []string) *LDAPQuery
SetAttributes sets the attributes to retrieve
func (*LDAPQuery) SetBaseDN
func (q *LDAPQuery) SetBaseDN(baseDN string) *LDAPQuery
SetBaseDN sets the base DN for the LDAP query
func (*LDAPQuery) SetDerefAliases
func (q *LDAPQuery) SetDerefAliases(deref int) *LDAPQuery
SetDerefAliases sets the behavior for alias dereferencing
func (*LDAPQuery) SetFilter
func (q *LDAPQuery) SetFilter(filter string) *LDAPQuery
SetFilter sets the search filter for the LDAP query
func (*LDAPQuery) SetPagingSize
func (q *LDAPQuery) SetPagingSize(size uint32) *LDAPQuery
SetPagingSize sets the size of the paging
func (*LDAPQuery) SetScope
func (q *LDAPQuery) SetScope(scope int) *LDAPQuery
SetScope sets the search scope
func (*LDAPQuery) SetSizeLimit
func (q *LDAPQuery) SetSizeLimit(limit int) *LDAPQuery
SetSizeLimit sets the maximum number of entries to return
func (*LDAPQuery) SetTimeLimit
func (q *LDAPQuery) SetTimeLimit(limit int) *LDAPQuery
SetTimeLimit sets the time limit for the search
func (*LDAPQuery) SetTypesOnly
func (q *LDAPQuery) SetTypesOnly(typesOnly bool) *LDAPQuery
SetTypesOnly specifies if only attribute types should be returned
func (*LDAPQuery) Validate
func (q *LDAPQuery) Validate() error
Validate checks if the LDAP query parameters are set correctly
type OUs
type OUs []*OrganizationalUnit
type OrganizationalUnit
OrganizationalUnit represents an AD Organizational Unit
type OrganizationalUnit struct {
DN string `ldap:"dn,omitempty"`
Name string `ldap:"name,omitempty"`
DistinguishedName string `ldap:"distinguishedName,omitempty"`
Description string `ldap:"description,omitempty"`
WhenCreated time.Time `ldap:"whenCreated,omitempty"`
WhenChanged time.Time `ldap:"whenChanged,omitempty"`
}
type Slice
Slice is an interface that ensures T is a slice type.
type Slice[T any] interface {
// contains filtered or unexported methods
}
type User
User represents an AD user with detailed fields (AKA: Contact) https://learn.microsoft.com/en-us/windows/win32/adschema/c-user
type User struct {
AccountExpires string `ldap:"accountExpires"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-accountexpires
AdminCount int `ldap:"adminCount"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-admincount
AltSecurityIdentities []string `ldap:"altSecurityIdentities"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-altsecurityidentities
BadPasswordTime int64 `ldap:"badPasswordTime"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-badpasswordtime
BadPwdCount int `ldap:"badPwdCount"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-badpwdcount
City string `ldap:"l"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-l
CodePage int `ldap:"codePage"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-codepage
CommonName string `ldap:"cn"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-cn
Country string `ldap:"c"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-c
CountryCode int `ldap:"countryCode"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-countrycode
Department string `ldap:"department"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-department
DistinguishedName string `ldap:"dn"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-distinguishedName
DSCorePropagationData string `ldap:"dSCorePropagationData"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-dscorepropagationdata
DisplayName string `ldap:"displayName"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-displayname
Division string `ldap:"division"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-division
EmployeeID string `ldap:"employeeID"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-employeeid
EmployeeNumber string `ldap:"employeeNumber"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-employeenumber
GivenName string `ldap:"givenName"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-givenname
InstanceType int `ldap:"instanceType"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-instancetype
LastLogoff int64 `ldap:"lastLogoff"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-lastlogoff
LastLogon int64 `ldap:"lastLogon"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-lastlogon
LastLogonTimestamp string `ldap:"lastLogonTimestamp"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-lastlogontimestamp
Manager string `ldap:"manager"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-manager
Mail string `ldap:"mail"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-mail
MemberOf []string `ldap:"memberOf"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-memberof
Mobile string `ldap:"mobile"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-mobile
Name string `ldap:"name"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-name
ObjectCategory string `ldap:"objectCategory"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectcategory
ObjectClass string `ldap:"objectClass"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectclass
ObjectGUID []byte `ldap:"objectGUID"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectguid
ObjectSID []byte `ldap:"objectSid"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-objectsid
PhysicalDeliveryOfficeName string `ldap:"physicalDeliveryOfficeName"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-physicaldeliveryofficename
PostalCode string `ldap:"postalCode"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-postalcode
PwdLastSet int64 `ldap:"pwdLastSet"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-pwdlastset
ReplPropertyMetaData string `ldap:"replPropertyMetaData"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-replpropertymetadata
SAMAccountName string `ldap:"sAMAccountName"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccountname
SAMAccountType int `ldap:"sAMAccountType"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccounttype
SN string `ldap:"sn"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-sn
StreetAddress string `ldap:"streetAddress"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-streetaddress
TelephoneNumber string `ldap:"telephoneNumber"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-telephonenumber
Title string `ldap:"title"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-title
UserAccountControl int `ldap:"userAccountControl"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-useraccountcontrol
UserPrincipalName string `ldap:"userPrincipalName"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-userprincipalname
USNChanged int64 `ldap:"uSNChanged"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-usnchanged
USNCreated int64 `ldap:"uSNCreated"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-usncreated
WhenChanged string `ldap:"whenChanged"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-whenchanged
WhenCreated string `ldap:"whenCreated"` // https://learn.microsoft.com/en-us/windows/win32/adschema/a-whencreated
}
type Users
### Active Directory Entities ---------------------------------------------------------------------
type Users []*User
Generated by gomarkdoc