win32security.GetTokenInformation
object = GetTokenInformation(TokenHandle, TokenInformationClass )
Retrieves a specified type of information about an access token. The calling process must have appropriate access rights to obtain the information.
Parameters
Return Value
The following types are supported
TokenInformationClass | Return type |
TokenSessionId | int - Terminal Services session id |
TokenSandBoxInert | Boolean |
TokenType | Value from TOKEN_TYPE enum (TokenPrimary,TokenImpersonation) |
TokenImpersonationLevel | Value from SECURITY_IMPERSONATION_LEVEL enum |
TokenVirtualizationEnabled | Boolean |
TokenVirtualizationAllowed | Boolean |
TokenHasRestrictions | Boolean |
TokenElevationType | int - TokenElevation* value indicating what type of token is linked to |
TokenUIAccess | Boolean |
TokenUser | (PySID,int) |
TokenOwner | PySID |
TokenGroups | ((PySID,int),) returns a list of tuples containing (group Sid, attribute flags) |
TokenRestrictedSids | ((PySID,int),) |
TokenPrivileges | ((int,int),) returns PyTOKEN_PRIVILEGES (tuple of LUID and attribute flags for each privilege) attributes are combination of SE_PRIVILEGE_ENABLED,SE_PRIVILEGE_ENABLED_BY_DEFAULT,SE_PRIVILEGE_USED_FOR_ACCESS |
TokenPrimaryGroup | PySID |
TokenSource | (string,LUID) |
TokenDefaultDacl | PyACL |
TokenStatistics | dict Returns a dictionary representing a TOKEN_STATISTICS structure |
TokenOrigin | LUID identifying the logon session |
TokenLinkedToken | PyHANDLE - Returns handle to the access token to which token is linked |
TokenLogonSid | PySID |
TokenElevation | Boolean |
TokenIntegrityLevel | (PySID, int) |
TokenMandatoryPolicy | int (TOKEN_MANDATORY_POLICY_* flag) |