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. Windows 11 swapped my administrator user email address with my alternate email address

    in Windows 10 Gaming
    Windows 11 swapped my administrator user email address with my alternate email address: I recently had my Windows 11 laptop reset to factory settings and windows reinstalled. I set it up correctly with only one account, myself as admin with my primary email address. I'm the only User so there are no other user sign-in options. I was in the process of reintalling...
  3. Windows 11 swapped my administrator user email address with my alternate email address

    in Windows 10 Software and Apps
    Windows 11 swapped my administrator user email address with my alternate email address: I recently had my Windows 11 laptop reset to factory settings and windows reinstalled. I set it up correctly with only one account, myself as admin with my primary email address. I'm the only User so there are no other user sign-in options. I was in the process of reintalling...
  4. Auto fetching DNS & Gateway IP address

    in Windows 10 Gaming
    Auto fetching DNS & Gateway IP address: Team,When users connect from home they connect to their respective wireless network & they are able to connect to internet accordingly however after connecting at home, in case they come & connect to wireless network in office it is not getting connected to the wireless...
  5. Auto fetching DNS & Gateway IP address

    in Windows 10 Network and Sharing
    Auto fetching DNS & Gateway IP address: Team,When users connect from home they connect to their respective wireless network & they are able to connect to internet accordingly however after connecting at home, in case they come & connect to wireless network in office it is not getting connected to the wireless...
  6. Auto fetching DNS & Gateway IP address

    in Windows 10 Software and Apps
    Auto fetching DNS & Gateway IP address: Team,When users connect from home they connect to their respective wireless network & they are able to connect to internet accordingly however after connecting at home, in case they come & connect to wireless network in office it is not getting connected to the wireless...
  7. Cannot change email address for user account

    in Windows 10 Customization
    Cannot change email address for user account: The email address no longer exists and it needs to be updated to new email address. The Manage option does not allow to change the email address associated with this user account. Someone with an authoritative solution Microsoft?, PLEASE. Why is something so simple...
  8. 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
  9. 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
  10. 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...