Group Policies

Changing Desktop Background Wallpaper in Windows through GPO

By January 1, 2020 No Comments

Let’s consider how to deploy the same desktop background image (wallpaper) on all Windows workstations in the Active Directory domain using Group Policies. As a rule, it is important for large businesses that require all employees using the same corporate desktop background image on all computers.

We’ll need an image file you want to use as a desktop wallpaper. It can be a BMP or JPG file. If the company uses monitors of various formats, you need to select the smallest monitor resolution and use this resolution for the wallpaper image. For example, if the minimum monitor resolution is 1280 x 1024, this is the wallpaper image resolution you need to use. In this case, the background image will be centered on the screen and displayed in fill mode.

This image file can be pre-copied to all computers, but it is more convenient if the clients take the jpeg file automatically from the shared network folder. To do this, you can use a file server, a SYSVOL folder on the domain controllers or a DFS folder. We have chosen the second variant for our distributed network since the SYSVOL contents are automatically replicated between all DCs and allow reducing WAN traffic between the branch offices when the clients are getting the image file.

Copy the image file on any domain controller to the C:\Windows\SYSVOL\sysvol\contoso.com\scripts\Screen folder. An UNC path to this file looks as follows: \\contoso.com\SYSVOL\contoso.com\scripts\Screen\corp_wallpaper.jpg.

wallpaper jpeg image file on sysvol share

Check that the domain users have read permissions for this file (grant Read NTFS permission for the Domain Users or Authenticated Users group).

How to Configure Desktop Wallpaper Settings via GPO?

Open the domain GPO Management console GPO (GPMC.msc). Create a new policy and assign it to the necessary OU with the users (in our case, we want the policy to be applied to all domain computers and servers, so we just edit the Default Domain Policy). Switch to the policy Edit mode.

Go to the section User Configuration -> Policies -> Administrative Templates -> Desktop -> Desktop.

Desktop Settings in GPO editor

Enable the policy Enable Active Desktop.

Enable Active Desktop policy

Then enable the Desktop Wallpaper policy. In the policy settings, specify the UNC path to the jpeg image file and select Fill as a wallpaper style.Tip. As a rule, Fill wallpaper style looks well almost at any screen resolution.

Desktop Wallpaper policy

To make sure that the policy has been enabled on a user’s computer, log off and sign in again. The user’s desktop should display the specified wallpaper image. If Group Policy settings are not applied on clients, you can use the gpresult command to diagnose the policy assignment (verify that your wallpaper policy is displayed in the Applied Group Policy Objects section).

If you have to prevent users from changing the wallpaper image, enable Prevent Changing Desktop Background policy in User Configuration -> Administrative Templates -> Control Panel -> Personalization.

Prevent Changing Desktop Background policy

If you want to more accurately target wallpaper policies for different users (computers), you can use WMI GPO Filters. For example, to apply desktop wallpaper image only to Windows 10 desktops, use the following WMI filter:

select * from Win32_OperatingSystem where Version like “10.%”

Set Desktop Wallpaper via Registry and GPP

You can set the parameters and the desktop wallpaper image through the registry. The path to the wallpaper image file is stored in the registry parameter Wallpaper (REG_SZ) under the registry key HKEY_CURRENT_USER\Control Panel\Desktop\ or HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System. You need to specify the UNC path to your image file in this registry parameter.

In the same registry key, the WallpaperStyle parameter (REG_SZ) sets the position of the image on the desktop. Use 2 to center and stretch the image.

If you want to prevent users from changing the desktop background. Create the following registry key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop]
"NoChangingWallPaper"=dword:00000001

These registry settings can be deployed to users’ computers through the special GPO extension – Group Policy Preferences (GPP). To do this, go to the User Configuration -> Preferences -> Windows Settings -> Registry section and create two registry settings with the Update action.

set desktop wallpaper via registry keys in gpo

With Group Policy Preferences Item Level Targeting, you can assign wallpaper policies to clients more accurately. For example, in the registry setting policy on the Common tab, enable Item level Targeting, click the Targeting button and use a simple wizard to specify that the wallpaper policy settings should be applied to computers with Windows 10 and users from a specific AD security group.

gpp: targeting wallpaper settings to ad security group

Similarly, you can make several different wallpaper files for different user groups (or devices). By adding the necessary users to AD groups, you can set different desktop wallpapers for different categories of employees.

Also, you can change the login screen image. To do this, you can use the Force a specific default lock screen image policy in the GPO section Computer Configuration -> Policies -> Administrative Templates -> Control Panel -> Personalization or through the following registry keys:

  • HKLM\Software\Policies\Microsoft\Windows\Personalization — LockScreenImage — path to jpg image for the lock screen;
  • HKLM\Software\Policies\Microsoft\Windows\Personalization — LockScreenOverlaysDisabled = 1;
  • HKLM\Software\Policies\Microsoft\Windows\System — DisableLogonBackgroundImage = 0.

Additionally, you can use GPOs to configure a single corporate slideshow screensaver from a set of jpeg images.

Why Desktop Wallpaper Group Policy Doesn’t Work for Windows 10 Clients?

On computers running Windows 10, the desktop wallpaper policy may not apply immediately. The fact is that Windows 7 and Windows 10 use the desktop background cache differently:

  • In Windows 7, every time a user logs on to the system, the background wallpaper cache is automatically regenerated;
  • In Windows 10, if the path to the wallpaper image has not changed, the cache doesn’t update. So the user will see the old desktop background, even if you updated the jpeg file in the shared folder on the server.

For Windows 10, you can add an additional logoff script that clears the image cache on the user sign out. It could be a bat file Clear_wallpaper_cache.bat with the following code:

del /F /S /Q %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper
del /F /S /Q %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\CachedFiles\*.*

bat file to clean wallpaper cache on windows 10

As a result, the desktop background image for Windows 10 users will be applied normally.

Leave a Reply