public interface SID
Consider the following output of examples/SidLookup.java:
toString: S-1-5-21-4133388617-793952518-2001621813-512
toDisplayString: WNET\Domain Admins
getType: 2
getTypeText: Domain group
getDomainName: WNET
getAccountName: Domain Admins
| Modifier and Type | Field and Description |
|---|---|
static int |
SID_TYPE_ALIAS |
static int |
SID_TYPE_DELETED |
static int |
SID_TYPE_DOM_GRP |
static int |
SID_TYPE_DOMAIN |
static int |
SID_TYPE_INVALID |
static int |
SID_TYPE_UNKNOWN |
static int |
SID_TYPE_USE_NONE |
static int |
SID_TYPE_USER |
static int |
SID_TYPE_WKN_GRP |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccountName()
Return the sAMAccountName of this SID unless it could not
be resolved in which case the numeric RID is returned.
|
String |
getDomainName()
Return the domain name of this SID unless it could not be
resolved in which case the numeric representation is returned.
|
SID |
getDomainSid() |
int |
getRid()
Get the RID
This is the last subauthority identifier
|
int |
getType()
Returns the type of this SID indicating the state or type of account.
|
String |
getTypeText()
Return text representing the SID type suitable for display to
users.
|
String |
toDisplayString()
Return a String representing this SID ideal for display to
users.
|
<T> T |
unwrap(Class<T> type) |
static final int SID_TYPE_USE_NONE
static final int SID_TYPE_USER
static final int SID_TYPE_DOM_GRP
static final int SID_TYPE_DOMAIN
static final int SID_TYPE_ALIAS
static final int SID_TYPE_WKN_GRP
static final int SID_TYPE_DELETED
static final int SID_TYPE_INVALID
static final int SID_TYPE_UNKNOWN
SID getDomainSid()
int getRid()
String toDisplayString()
Specifically, if the SID has been resolved and it is not a domain SID or builtin account, the full DOMAIN\name form of the account will be returned (e.g. MYDOM\alice or MYDOM\Domain Users). If the SID has been resolved but it is is a domain SID, only the domain name will be returned (e.g. MYDOM). If the SID has been resolved but it is a builtin account, only the name component will be returned (e.g. SYSTEM). If the sid cannot be resolved the numeric representation from toString() is returned.
String getAccountName()
String getDomainName()
String getTypeText()
int getType()
SID types are described in the following table.
| Type | Name |
|---|---|
| SID_TYPE_USE_NONE | 0 |
| SID_TYPE_USER | User |
| SID_TYPE_DOM_GRP | Domain group |
| SID_TYPE_DOMAIN | Domain |
| SID_TYPE_ALIAS | Local group |
| SID_TYPE_WKN_GRP | Builtin group |
| SID_TYPE_DELETED | Deleted |
| SID_TYPE_INVALID | Invalid |
| SID_TYPE_UNKNOWN | Unknown |
<T> T unwrap(Class<T> type)
type - Copyright © 2023. All rights reserved.