win32security.LookupAccountName

PySID, string, int = LookupAccountName(systemName, accountName )

Accepts the name of a system and an account as input. It retrieves a security identifier (SID) for the account and the name of the domain on which the account was found.

Parameters

systemName : string

The system name, or None

accountName : string

The account name

Return Value

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