Link to home
Start Free TrialLog in
Avatar of RainMakker
RainMakker

asked on

How do I get the GUID of the currently logged in user?

I would like to be able to get the Active Directory GUID of the logged in user from the windows registry.  I see my GUID in:

HLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*\<guid>

But looking through all of these values to see if the "ProfileImagePath" matches the logged in user name seems goofy.  I can easily get the logged in user name with my Delphi app, so this is very doable, but it seems a strange way to go about it.

Any suggestions?
Avatar of DMTechGrooup
DMTechGrooup
Flag of United States of America image

Avatar of RainMakker
RainMakker

ASKER

Thanks, but . . .

1.  The first one gets users logging into a remote computer.  I need the user logged into the local machine.
2.  The second gets the GUID from Active Directory, I need the GUID from the local machine to validate against active directory.
3.  I really need to make this work within my computer, not in a command window.
Avatar of Sinisa Vuk
Please take a look at theroadtodelphi blog. This is a good delphi resource. Using ADSI interface - you should be able to get a lots of information about AD without to dig in registry.
ASKER CERTIFIED SOLUTION
Avatar of RainMakker
RainMakker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No other answer helped.