The GetSid method retrieves the user's security identifier (SID). HRESULT GetSid( LPBYTE pbSidBuffer, DWORD cbSidBuffer );