Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Group Policies / Changing Desktop Background Wallpaper in Windows through GPO

November 26, 2020 Active DirectoryGroup Policies

Changing Desktop Background Wallpaper in Windows through GPO

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.

Contents:
  • How to Configure Desktop Wallpaper Settings via GPO?
  • Set Desktop Wallpaper via Registry and GPP
  • Why Desktop Wallpaper Group Policy Doesn’t Work for Windows 10 Clients?

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\woshub.loc\scripts\Screen folder. An UNC path to this file looks as follows: \\woshub.loc\SYSVOL\woshub.loc\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.

 

 

12 comments
0
Facebook Twitter Google + Pinterest
previous post
Secure Password (Credentials) Encryption in PowerShell Scripts
next post
VMWare ESXi Doesn’t Detect FC HBA adapters

Related Reading

Add an Additional Domain Controller to an Existing...

September 6, 2023

Fix: Remote Desktop Licensing Mode is not Configured

August 24, 2023

Refresh AD Groups Membership without Reboot/Logoff

July 15, 2023

How to Backup and Copy Local Group Policy...

July 6, 2023

How to Reset the Group Policy Settings on...

June 23, 2023

12 comments

Canny Con April 20, 2016 - 10:07 am

Group policy works only once for win 10 clients.
I mean, when a user login to a win 10 client PC, It gets the wallpaper from server.
Now if we change the wallpaper on the server (By replacing that .bmp file with same name) it never changes on client computer.
However if a new user login to the same PC, it gets the new wallpaper.
Can you please help!
Thanks.
 
 

Reply
admin April 22, 2016 - 5:44 am

Try to use a different file name

Reply
Peter August 8, 2016 - 2:56 pm

This won’t work for a Computer object OU as desktop wallpaper is User config? You need loopback enabled right??

Reply
Max August 22, 2016 - 9:47 am

In this example GPO is targeted to the users OU. If you want apply background policy to OU containing computers, you should enable loopback mode.

Reply
Richard April 18, 2018 - 5:16 pm

Hello dear,

I need your help How to change the wallpaper on a daily or weekly basis? but having GPO.

Greetings and thanks! Richard

Reply
admin April 20, 2018 - 10:06 am

I think you’ll have to use the scheduler tasks or PowerShell scripts to change the path to wallpaper file in registry.
[HKEY_CURRENT_USER\Control Panel\Desktop]
"Wallpaper"=" C:\Windows\SYSVOL\sysvol\woshub.loc\scripts\Screen\mon.jpg"

Also you can daily replace shared wallpaper file \\woshub.loc\SYSVOL\woshub.loc\scripts\Screen\corp_wallpaper.jpg using the task scheduler on DC.

Reply
Richard April 21, 2018 - 7:20 am

Hello admin!

Thank you for your prompt response,

You are currently applying problems, I mean that it is updated automatically every day.

Regards,

Richard

Reply
Richard April 21, 2018 - 7:30 am

@echo off
echo.
echo Eliminando el archivo fondo de pantalla existente…
echo.
del /q C:\Scripts\Wallpaper\wallAplicated\wallpaper.jpg
echo.
echo Configurando las variables aleatorias…
echo.
C:
CD C:\Scripts\Wallpaper\wallpapers\
echo.
set /a myRand=%random%%%20+1
set /a myRand=%random%%%20+1
echo.
echo Copiando y renombrando el archivo aleatorio al directorio GPO para ser aplicado…
echo.
copy wallpaper%myRand%.jpg C:\Scripts\Wallpaper\wallAplicated\wallpaper.jpg
echo.
echo Listo!! El fondo de pantalla ha sido cambiado satifatoriamente!
echo.
echo Esperando 5 Segundos para finalizar…….
timeout /t 5
Exit
—————————————————————————–

I am currently applying this script found here, which is excellent, but I repeated the images the next day: http://www.edugeek.net/forums/windows-server-2008/104870-change-wallpaper-daily-via-gpo.html

I was able to apply the indicated script every day with 20 wallpaper, however, I have noticed that sometimes the same image is repeated a few times.

How can I solve so that the same image is not repeated in those 20 days? so that all the wallpaper will be applied.

Greetings and thanks in advance for your answers.

Richard

Reply
admin April 24, 2018 - 5:45 am

You can try to rename jpg files in the C:\Scripts\Wallpaper\wallpapers\ folder every day according to the following scheme. For example, you have 5 jpg files:
wallpaper.jpg – (current wallpaper image)
wallpaper1.jpg
wallpaper2.jpg
wallpaper3.jpg
wallpaper4.jpg
wallpaper5.jpg

Next to rotate wallpaper files use the following code:

REN wallpaper.jpg wallpaper_tmp.jpg
REN wallpaper1.jpg wallpaper.jpg
REN wallpaper2.jpg wallpaper1.jpg
REN wallpaper3.jpg wallpaper2.jpg
REN wallpaper4.jpg wallpaper3.jpg
REN wallpaper5.jpg wallpaper4.jpg
REN wallpaper_tmp.jpg wallpaper5.jpg

Reply
Richard April 24, 2018 - 5:24 pm

Ok excellent, they also gave me that same idea and it works for me. I think it was the most practical and uncomplicated.

Expert Comment by:Steve Knight
https://www.experts-exchange.com/questions/29095902/How-to-change-the-wallpaper-randomly-to-all-users-of-the-domain-every-day-without-being-repeated.html

Thank you very much for helping me!

Regards!

Reply
Rizwan March 3, 2022 - 5:35 am

Hi We deploy Wallpaper via GPO and it’s work well but when ever we switch Laptop network on wifi wallpaper not apply over wifi and see black screen only, in LAN network it’s working fine.
Thanks in Advance please help here

Reply
admin March 3, 2022 - 6:16 am

Strange problem. Is your domain controller accessible when connected via a Wi-Fi network?

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Deploy PowerShell Active Directory Module without Installing RSAT
  • Managing User Photos in Active Directory Using ThumbnailPhoto Attribute
  • How to Restore Active Directory from a Backup?
  • Active Directory Dynamic User Groups with PowerShell
  • Restricting Group Policy with WMI Filtering
  • Windows: Block Remote Network Access for Local User Accounts
  • Auditing Weak Passwords in Active Directory
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top