none
Windows 8 Account Picture

    Question

  • Hi, 

    I would like to set the user account picture via PowerShell for a domain user.

    I've already tried to copy the accountpicture-ms to C:\Users\$CurrentUser\appdata\Roaming\Microsoft\Windows\AccountPictures and set the corresponding registry key

    Set-ItemProperty -Path
    "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AccountPicture"
    -Name SourceId -Value $AccountPicture -type string

    There is an API (http://msdn.microsoft.com/en-us/library/windows/apps/br241881.aspx) for Win8, but I can't figure it out to use it in PowerShell.

    I would like to change the account picture without user interaction

    Any help would be appreciated.


     

    Thursday, November 29, 2012 3:28 PM

All replies

  • To set the "picture" for domain users (which I have never done), it would probably be best to use the corresponding AD attribute, which is either "thumbnailPhoto" or "picture".

    I do not know if this will achieve what you want on windows 8 clients. On my non-domain windows vista and windows 7 computers at home, the picture appears in the logon screen, the top of the start menu, and in control panel - users. I understand that when these are joined to a domain, the welcome screen is replaced by the typical domain logon dialog box. And, of course, the domain accounts would never show up in control panel - users.


    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

    Thursday, November 29, 2012 5:49 PM
  • Are you wanting to set a "default" picture for all users when they login or is it a different picture based on who the user is?
    Thursday, November 29, 2012 7:48 PM
  • Hello Tim,

    I would like to set the picture for every single user not a default picture.

    Friday, November 30, 2012 8:58 AM
  • Hi Peter,

    This might work ;)

    http://msitpros.com/?p=1036

    Regards

    Dan


    Friday, November 30, 2012 4:27 PM
  • Hi Dan,

    this works in Windows 7 not in Windows 8. :-(

    Regards,

    Peter

    Monday, December 03, 2012 8:47 AM
  • same problem :(

    how can i set image for local accounts in Windows 8-2012?

    I need use command-line application, or powershell script for change image in group policy

    I found examples

    http://www.c-sharpcorner.com/UploadFile/99bb20/set-account-picture-in-windows-store-apps-using-C-Sharp/

    http://code.msdn.microsoft.com/windowsapps/Account-picture-name-sample-912baff1

    but they for Windows Store

    Monday, March 11, 2013 10:42 AM
  • I found this way

    http://undoc.airesoft.co.uk/shell32.dll/SHSetUserPicturePath.php

    but i don`t know how it used with c# :(

    Can anyone test this way?

    Information of using similar method I found in

    http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/98cb2f4d-d8a4-429a-93f0-972495299e11

    "It's ordinal 810 in shell32.dll in all Vista+ OS's including 8"

    Tuesday, March 12, 2013 3:28 PM
  • any solutions?
    Tuesday, March 19, 2013 7:17 AM
  • any? :)
    Friday, April 12, 2013 7:09 AM
  • I would like to know this too.
    Searching for methods to use the AD picture (indeed, stored in picture or thumbnailPhoto attribute of the ADuser) as the user picture in Windows 8 or Windows 8.1.

    I am looking for a C# program that can put the picture if I tell it where to get the picture, or a powershell script that incorporates the SHSetUserPicture function from Shell32.dll.

    I found some documentation on that function and found serveral examples on how to use Shell32.dll functions in powershell scripts, but I don't have enought C/C++ knowledge to put it all together :(

    If anyone can have a look at how to use this function from powershell scripts, would be much appriciated!

    Thanks!

    Arjan

    SHSetUserPicturePath


    Changes a users picture that is displayed at logon and on the start menu.

    Syntax

    HRESULT WINAPI SHSetUserPicturePath (
        LPWSTR pwszAcctName,
        DWORD reserved,
        LPCWSTR pwszPictureFile
    )

    Parameters

    pwszAcctName
    The name of the user to set the picture of
    reserved
    Reserved, must be 0.
    pwszPictureFile
    Path of the file containing the new user picture

    Return Value

    S_OK on success, S_FALSE is the picture to set is the current one, and other common COM errors on failure

    Remarks

    CoInitialize(NULL)/CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) must be called prior to calling this function.

    Friday, October 04, 2013 6:09 PM
  • Hello,

    someone has been successful for this job?

    Thanks,

    Monday, November 25, 2013 9:54 AM
  • Hi all!

    Not a clue if anyone still needs this but I found this:

    http://www.parackattu.com/2014/04/windows-8-windows-81-set-account.html

    It's a VB.net executable and GPO combo, fully explained on that page.

    The author even has a download link for the source code up.

    Enjoy


    There's a new blog in town: http://msfreaks.wordpress.com

    Thursday, May 01, 2014 1:22 PM
  • That page was pretty helpful, I re-wrote the code into PowerShell for anyone who's interested: http://blog.jourdant.me/ps-setting-windows-8-account-picture-from-ad

    Jourdan

    Friday, June 13, 2014 11:47 AM