-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsam_account_type.go
49 lines (46 loc) · 1.46 KB
/
sam_account_type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package ldap
// SamAccountType is a bit mask that defines the type of an account.
// https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccounttype
type SamAccountType uint32
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 (t SamAccountType) String() string {
switch t {
case SamDomainObject:
return "Domain Object"
case SamGroupObject:
return "Group Object"
case SamNonSecurityGroupObject:
return "Non-Security Group Object"
case SamAliasObject:
return "Alias Object"
case SamNonSecurityAliasObject:
return "Non-Security Alias Object"
case SamUserObject:
return "User Object / Normal User Account"
case SamMachineAccount:
return "Machine Account"
case SamTrustAccount:
return "Trust Account"
case SamAppBasicGroup:
return "App Basic Group"
case SamAppQueryGroup:
return "App Query Group"
case SamAccountTypeMax:
return "Account Type Max"
default:
return "Unknown"
}
}