Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I extract the current user's account picture?

I am trying to extract the current user's account picture in Windows 7, but I can't seem to figure out where it is located. I have found that the picture is sometimes written to the User's temp folder, but only after performing certain actions. It isn't always guaranteed to be there. Has anyone had any luck extracting this image? Thanks!

Update: I am trying to extract the image using C++, but help in any language would be a big step. :)

like image 719
Jon Tackabury Avatar asked Apr 20 '10 18:04

Jon Tackabury


People also ask

How do I download a Microsoft account picture?

If you have the option to right click the picture and select 'Save picture as', that will solve your concern. But if not, I may suggest that you simply use a snipping tool. After capturing the picture, click File > Save as > Save it to your desired folder and you'll have the picture file that you want. Hope that helps!

Where are user account pictures stored?

In Windows 10/8/7, the default account picture images are stored in the hidden system folder: C:\ProgramData\Microsoft\User Account Pictures. Here's how to reset account picture to default in Windows 10/8: Click the Start button or press the Windows logo key on your keyboard.

Where are windows account pictures stored?

Open File Explorer from the taskbar. If you don't see File Explorer on the taskbar, select Start and type File Explorer. Go to C:\Users\yourname\AppData\Roaming\Microsoft\Windows\AccountPictures.

Where is Microsoft Teams profile picture stored?

User photos are stored in the user's Active Directory account and in the root directory of the user's Exchange mailbox and this is the PowerShell command to set it.


2 Answers

Whenever an API call needs the UserTile, it is copied to %TEMP%\%USERNAME%.bmp, which is usually C:\Users\username\AppData\Local\Temp\username.bmp.

But if you need to extract it directly from SAM, you can adapt the details from http://deployment.xtremeconsulting.com/2010/06/23/usertile-automation-part-1/, to make a program to read HKLM\SAM\SAM\Domains\Account\Users\????????\UserTile (in system context!), skip 12 bytes, read 4 bytes to uint, and read that uint number of bytes into a file.

Edit: I feel I should add that the API call that Explorer in Windows XP uses to get the icon, is an unnamed address in one of the logon DLL's (hence you can not call it yourself, since that address should change between versions), I can not remember which exact DLL at the moment.

like image 180
frozen Avatar answered Oct 05 '22 22:10

frozen


It's described here under User Profile Tiles in Windows 7. It doesn't seem very encouraging.

like image 23
Alex K. Avatar answered Oct 05 '22 20:10

Alex K.