Obtain registrations on the user's SID, not at the elevated level

How do I get the SID of a logged in user in a .NET elevated application?

I tried WindowsIdentity.GetCurrent()

, which of course returns the admin who kicked the process up. From what I can see, I may need to use my own methods for this, can anyone provide a more elegant way?

+3


source to share


1 answer


Investigating Greg's recommendation to use the registry:

I found the following clue which seems to be reliable when providing information about the current user. This key contains information such as display name and SID. This information is stored in "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Authentication \ LogonUI"



This information is correct in Windows 8. I have checked Windows 7 and there is much less information including: for example, the user's SID is not registered.

0


source







All Articles