win32security.LookupAccountSid

string, string, int = LookupAccountSid(systemName, sid )

Accepts a security identifier (SID) as input. It retrieves the name of the account for this SID and the name of the first domain on which this SID is found.

Parameters

systemName : string

The system name, or None

sid : PySID

The SID

Return Value

The result is a tuple of the name, the domain name where the account was found, and the type of account the SID is for.