win32security.AdjustTokenPrivileges

PyTOKEN_PRIVILEGES = AdjustTokenPrivileges(TokenHandle, bDisableAllPrivileges , NewState )

Enables or disables privileges for an access token.

Parameters

TokenHandle : PyHANDLE

Handle to an access token

bDisableAllPrivileges : int

Flag for disabling all privileges

NewState : PyTOKEN_PRIVILEGES

The new state, can be None if bDisableAllPrivileges is True

Comments

Accepts keyword args.

Return Value

Returns modified privileges for later restoral. Privileges deleted from the token using SE_PRIVILEGE_REMOVED are not returned.