How to check whether different forms of Windows user account relate to the same user?

StackOverflow https://stackoverflow.com/questions/13239739

  •  27-11-2021
  •  | 
  •  

سؤال

Windows account name can have various forms in different contexts - I am interested in bringing account name to some canonical form if possible, or in checking whether two account names apply to the same account in a context of a given machine. For example:

.\Hobson
HobMachine\Hobson
localhost\Hobson

or

HobDomain\Hobson
HOBSON@HOBDOMAIN

Above two sets of names name the same user each (when used in appropriate context, e.g. first one is checked on machine called HobMachine). How can I check programmatically (preferably C#), whether two account names apply to the same account in a context of given machine?

هل كانت مفيدة؟

المحلول

I could be wrong, but it seems like you'd have to decide that just by the name. I'm not aware of anything that links domain accounts to local accounts since they are different accounts.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top