Finding Current User's SID in Windows 2000 Server & Windows XP

  • Thread starter Thread starter Ron Sochanski
  • Start date Start date
R

Ron Sochanski

Hello. An installation program of mine can successfully
install on Windows 9.x and Windows 2000 Professional, but
not on Windows 2000 Server or Windows XP. Specifically,
the program generates an error and halts when it cannot
find the current user's SID, which on all Windows
9.x/Windows 2000 Professional systems I've encountered, is
contained as value data in the value named OwnerSID of the
following registry key:

HKLM\SOFTWARE\Microsoft\EventSystem\{26c409cc-ae86-11d1-
b616-00805fc79216}\Subscriptions\{6295DF30-35EE-11D1-8707-
00C04FD93327}

Windows 2000 Server and Windows XP don't appear to use
this key, thus the error described above. Furthermore, I
looked through the Windows 2000 Server registry hoping to
find another key that has a value whose data is the SID,
but can't seem to find one. How can I get the current
user's SID from Windows 2000 Server and Windows XP? Any
help would be greatly appreciated!

Thank you.

Ron Sochanski
 
In said:
Hello. An installation program of mine can successfully
install on Windows 9.x and Windows 2000 Professional, but
not on Windows 2000 Server or Windows XP. Specifically,
the program generates an error and halts when it cannot
find the current user's SID, which on all Windows
9.x/Windows 2000 Professional systems I've encountered, is
contained as value data in the value named OwnerSID of the
following registry key:

HKLM\SOFTWARE\Microsoft\EventSystem\{26c409cc-ae86-11d1-
b616-00805fc79216}\Subscriptions\{6295DF30-35EE-11D1-8707-
00C04FD93327}

Windows 2000 Server and Windows XP don't appear to use
this key, thus the error described above. Furthermore, I
looked through the Windows 2000 Server registry hoping to
find another key that has a value whose data is the SID,
but can't seem to find one. How can I get the current
user's SID from Windows 2000 Server and Windows XP? Any
help would be greatly appreciated!

This tool
C\UTIL\SysInternals>psgetsid %username%

PsGetSid v1.41 - Translates SIDs to names and vice versa
Copyright (C) 1999-2004 Mark Russinovich
Sysinternals - www.sysinternals.com

SID for W2K\USER:
S-1-5-21-796845957-839522115-nnnnnnnnnn-1000

Might help. They don't seem to have source code for this tool and I
do not know what APIs are utilized. Admin. authority required.

- - -

You might enumerate:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\ProfileList\
perhaps. For local profiles.

Not sure any of that helps.
 
Back
Top