$keySubpath = "SOFTWARE\Microsoft\Windows\CurrentVersion\AccountPicture\Users\$sid" $picturesKey = Join-Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AccountPicture\Users $sid # Create or gain access to the picture Registry key grant 'Administrators:(OI)(CI)F' | Out-Null $picturesFolder = Join-Path (Join-Path $env:PUBLIC 'AccountPictures') $sid # Create or gain access to the AccountPictures subfolder $picture = ::FromFile((gi $PicturePath).FullName) $pictureGuid = ::NewGuid().ToString().ToUpper() $sid = ::new($UserName).Translate().ToString() To automate this process, I wrote a PowerShell script based on this forum post: Param( Strangely, both the subkeys and subfolders allow full control only to the singular Administrator account instead of the Administrators group, so writing to them requires adjusting the ACL, after taking ownership in the case of the folder. The files should be readable by Everyone. When you create an account picture with the Settings app, the images are stored in a subfolder of C:\Users\Public\AccountPictures named for your SID. Image32, storing the full path to the image. Each subkey has a handful of Image# entries, one for each image size, e.g. Specifically, each user's account picture is stored under this key as described in this other answer: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AccountPicture\UsersĮach subkey's name is the SID of the user whose picture it specifies. There is no UI to set the picture of a different specific user, but you can do it by creating versions of the picture with all necessary sizes and modifying the Registry to point to them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |