Technology Solutions for Everyday Folks
Windows logo

Visual Customizations for Windows 10 in OSD

As we work through the tail-end of our Windows 7 fleet (January 14, 2020 is coming if you haven't heard...), I've found myself rolling a different type of hammer process for the last of the "upgrades." This past week as I was tweaking what amounts to an in-place update (by way of wipe and load) for Windows 7 to Windows 10, I was reminded of how Past Me was indeed awesome (and inspired) since this simple script with all the various background and image sizes still works in Windows 10 19XX deployments.

For a few years now, thanks to inspiration from MMS (Jörgen, Gary, and Mark) and others in the community and because Pretty Matters, I've been using a variation of Trevor Jones's script to set the default wallpaper during OSD. My modification includes a baked-in bit to also handle the various default user profile icons and also sets a couple of registry keys to "enforce" the lock screen default with a slightly larger hammer.

My customizations are shared in a GitHub repo for easy access, but the simple script is included below as well:

$ImagePath = 'Backgrounds'
$IconPath = 'UserIcons'
# Remove old wallpaper
Remove-Item $env:windir\Web\Wallpaper\Windows\img0.jpg -Force -Confirm:$false

# Copy new default wallpaper
Copy-Item $PSScriptRoot\$ImagePath\img0.jpg $env:windir\Web\Wallpaper\Windows -Force
Copy-Item $PSScriptRoot\$ImagePath\customlogon.jpg $env:windir\Web\Wallpaper\Windows -Force

# Define image file list
$Images = @(
    'customlogon.jpg'
    'img0.jpg'
    'img0_1024x768.jpg'
    'img0_1200x1920.jpg'
    'img0_1366x768.jpg'
    'img0_1600x2560.jpg'
    'img0_2160x3840.jpg'
    'img0_2560x1600.jpg'
    'img0_3840x2160.jpg'
    'img0_768x1024.jpg'
    'img0_768x1366.jpg'
)

# Copy each 4K image
Foreach ($Image in $Images)
{
    Copy-Item "$PSScriptRoot\$ImagePath\$Image" $env:windir\Web\4K\Wallpaper\Windows -Force
}

# Set Machine Default for the lock screen (this is also accomplished by way of GPO, but we do it here too)
$path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" 
$img =  "$env:windir\Web\Wallpaper\Windows\customlogon.jpg"

# Apply Registry Keys
If (!(Test-Path $path))
{
    New-Item -Path $path -Force
    New-ItemProperty -Path $path -Name LockScreenImage -Value $img
} else {
    Set-ItemProperty -Path $path -Name LockScreenImage -Value $img
}

# USER ICONS
#
# Define image file list
$UserImages = @(
    'user.png'
    'user.bmp'
    'user-32.png'
    'user-40.png'
    'user-48.png'
    'user-192.png'
)

# Copy each User Icon
Foreach ($Image in $UserImages)
{
    Copy-Item "$PSScriptRoot\$IconPath\$Image" "$env:ProgramData\Microsoft\User Account Pictures" -Force
}

Future Opportunities

In our environment, I have separate packages for each of the background/icon variations for the organization. I'd like to bolt in some additional logic (likely by way of task sequence variables) to further reduce the number of task sequence steps (at the slight expense of a larger single package) and maintenance complexity. The script wouldn't change much (in theory) other than setting the root path for the source images.

Headline image via wired

Comments

Post Comments

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
I completely believe you're a human, but because the Internet exists I have to request you demonstrate it before submitting a comment.