Windows 10: Fetching the user's email address

Discus and support Fetching the user's email address in AntiVirus, Firewalls and System Security to solve the problem; I found out that using the stored email used to sign in with Windows, Microsoft Live, Skype is the best way to determine (in all probability) the... Discussion in 'AntiVirus, Firewalls and System Security' started by Michael Haephrati, Aug 19, 2018.

  1. Fetching the user's email address


    I found out that using the stored email used to sign in with Windows, Microsoft Live, Skype is the best way to determine (in all probability) the active email address of the user.


    Windows stores used email accounts used as "Live ID" in the "UserExtendedProperties" key in



    HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL

    The assumption is that this email was selected by the user as the Windows user name to log in to the PC and/or to other Windows services.

    Therefore you can get the email accounts using the following code:



    //
    void GetDefaultEmailAddress()

    {
    HKEY key;
    TCHAR achKey[MAX_KEY_LENGTH]; // buffer for subkey name
    DWORD cbName; // size of name string
    TCHAR achClass[MAX_PATH] = TEXT(""); // buffer for class name
    DWORD cchClassName = MAX_PATH; // size of class string
    DWORD cSubKeys = 0; // number of subkeys
    DWORD cbMaxSubKey; // longest subkey size
    DWORD cchMaxClass; // longest class string
    DWORD cValues; // number of values for key
    DWORD cchMaxValue; // longest value name
    DWORD cbMaxValueData; // longest value data
    DWORD cbSecurityDescriptor; // size of security descriptor
    FILETIME ftLastWriteTime; // last write time

    DWORD i, retCode;

    TCHAR achValue[MAX_VALUE_NAME];
    DWORD cchValue = MAX_VALUE_NAME;

    if (RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\IdentityCRL\\UserExtendedProperties", NULL, KEY_READ, &key) == ERROR_SUCCESS)
    {
    // Get the class name and the value count.
    retCode = RegQueryInfoKey(
    key, // key handle
    achClass, // buffer for class name
    &cchClassName, // size of class string
    NULL, // reserved
    &cSubKeys, // number of subkeys
    &cbMaxSubKey, // longest subkey size
    &cchMaxClass, // longest class string
    &cValues, // number of values for this key
    &cchMaxValue, // longest value name
    &cbMaxValueData, // longest value data
    &cbSecurityDescriptor, // security descriptor
    &ftLastWriteTime); // last write time

    // Enumerate the email accounts subkeys, until RegEnumKeyEx fails.

    if (cSubKeys)
    {
    wprintf(TEXT("\nNumber of email accounts used: %d\n"), cSubKeys);

    for (i = 0; i < cSubKeys; i++)
    {
    cbName = MAX_KEY_LENGTH;
    retCode = RegEnumKeyEx(key, i,
    achKey,
    &cbName,
    NULL,
    NULL,
    NULL,
    &ftLastWriteTime);
    if (retCode == ERROR_SUCCESS)
    {
    wprintf(TEXT("(%d) %s\n"), i + 1, achKey);
    }
    }
    }
    }
    }

    //

    :)
     
    Michael Haephrati, Aug 19, 2018
    #1
  2. Kari Win User

    different user accounts, only one email address?


    Hi Geoff, welcome to the Ten Forums.

    In Windows 10 it is not possible to use the same MS account for more than one user account on the same computer. If User-A signs in with an MS account User-A@AnyEmail.com, that MS account (email address) cannot be used to sign in any other user than User-A. User-B needs to use either a different MS account or a local account. However, you can use the same MS account on multiple computers.

    There's no way to work around this restriction.

    In your case I would simply install Windows 10 on both computers with a local admin account, then create an additional standard user account as an MS account on both computers using the same email address. If any of the two computers requires the gaming account, too, as you explained I would make this account a local account.

    Tutorials:
     
  3. Bastet Win User
    Win10 Mail - where's the address book?


    That’s now the People app. Fetching the user's email address :)
    If you know the contact's name or email address & they’re listed in the People app, you can start typing the first few letters of their name or email address and Mail for Windows 10 will suggest matching contacts.
     
    Bastet, Aug 19, 2018
    #3
  4. Sam Vimes Win User

    Fetching the user's email address

    Mail App: Removing drop down email address suggestions


    I'm not a big fan of the MS Mail program and don't really use it for serious stuff but somehow or other if I create a new email then as I start to enter the recipients address a whole load of suggestions will appear. I don't have any contacts in the People app so I'm not sure where these come from.

    The question is how can I clear this list so that I no longer get the suggestions?

    Thanks
     
    Sam Vimes, Aug 19, 2018
    #4
Thema:

Fetching the user's email address

Loading...
  1. Fetching the user's email address - Similar Threads - Fetching user's email

  2. Email address

    in Windows 10 Customization
    Email address: I got an new computer. I put in a bad Email address, and the system will not let me fix the typo for the right address for my account. How do fix the? Everything show to add address, but does not go far enough bad addresses....
  3. Email address

    in Windows 10 Customization
    Email address: OK, I have been told that once you have set up your Microsoft account you cannot change your signin. I am trying to get away from AOL and that address is what I set my account up with. Is there anyway to change it or do I have to open up a brand new account. I am...
  4. Is Mozilla Thunderbird slow at fetching and sending emails?

    in Browsers and Email
    Is Mozilla Thunderbird slow at fetching and sending emails?: My ISP claims it's not their mail server... So is Mozilla Thunderbird slow at fetching and sending emails? I have a very fast broadband connection. Just curious. *really 125520
  5. Email addresses

    in Windows 10 Installation and Upgrade
    Email addresses: Recently changes from Windows 7 to Windows10 and now all of my email addresses and contacts have disappeared. How do I find them again?? https://answers.microsoft.com/en-us/windows/forum/all/email-addresses/39a22e1f-af51-46f8-bd27-b9ccfc35d616
  6. Email address

    in Windows 10 Customization
    Email address: How do you eliminate unwanted names that appear when you begin entering an email addressee name? https://answers.microsoft.com/en-us/windows/forum/all/email-address/f00d841f-acd3-4d7d-a208-aea9873673b6
  7. Email address

    in Windows 10 Software and Apps
    Email address: How do I allocate my email address to the Photo viewer. So can attach a photo to an email? https://answers.microsoft.com/en-us/windows/forum/all/email-address/37d05dd8-beea-4138-8756-c645ddd07ba1
  8. email address

    in Windows 10 Software and Apps
    email address: When I change an email address in "people" and then go to use it in "Mail" I get the old one. I check in "People" again and I get the new and all of the old email addresses. What's up Moved from: Windows 10 / Files, folders, & storage...
  9. Finder the user's email address

    in AntiVirus, Firewalls and System Security
    Finder the user's email address: I found out that using the stored email used to sign in with Windows, Microsoft Live, Skype is the best way to determine (in all probability) the active email address of the user. Windows stores used email accounts used as "Live ID" in the "UserExtendedProperties" key in...
  10. Email address

    in Browsers and Email
    Email address: I tried to send an email using live.com, my Microsoft address, and their address was invalid yet when I put the exact address the recipient in Gmail it worked. Any explanations please. Thank you Peter 47419