Dec 28 2021 10:23 PM
Hi Team,
I would like to set the static wallpaper for all the users. I Achieved the same by using the Computer local policy.
https://appuals.com/set-a-default-background-wallpaper-for-all-users-in-windows-10/
But I would like to achieve the same by using Powershell Script. Unfortunately I am getting the GPO domain level rather than the local computer.
Can someone assist me how can I get and set the local computer policy ?
Dec 28 2021 11:46 PM
Hi, @Vinay335
I have some question about your environment.
Is there any group policy for change desktop wall paper?
If it exist, you can't change wallpaper via local group policy. You just said you achieved the success with local policy, but it maybe temporarily.
If not, you have a 2 direction.
A. Using LGPO.exe
- Export local group policy template
- Modify exported template for only adjust wallpaper template
- Adjust modified template to other pc with Powershell
B. Change registry value with Set-ItemProperty
[Ref]
-LGPO
-Set-ItemProperty
Dec 29 2021 12:21 AM
@somnio0505
Thanks for your response. There is no GPO for the desktop wallpaper.
Set-ItemProperty : with this I can only able to change the current user session only. Not for every user.
I believe LGPO is the only option.
Do we have any powershell cmdlet to use this LGPO ?
Dec 29 2021 12:46 AM
If you want to chagne all local user's desktop wallpaper, you should change "HKEY_USERS" registry value not a HKEY_CURRENT_USER.
You can change other user's value HKLM > HKU\SID(S-1-xxxx)
But it's temporarily too.
LGPO is standalone. You just type LGPO commands in script.
# Export (Backup)
# You shoud using path all user can access.
"PATH"\LGPO.exe /b "PATH"\"BACKUP"
# Adjust
"PATH"\LGPO.exe /g "PATH"\"BACKUP"
There are several things to watch out before you try this.
* Other local policies are being used individually
* How to execute LGPO to all users.
The question arises as I write this, why was the group policy excluded?
Dec 29 2021 01:13 AM
Dec 29 2021 04:40 PM
Hi, @Vinay335
I tested the logon script for overwrite group policy.
It works on my test environment. Please try below steps in your env.
1. Deploy your wallpaper image to user.
eg. C:\temp\wallpaper.jpg
or you can use shared folder which all user can access. \\xx.xx.xx.xx\___\wallpaper.jpg but it has a issues when using a NAC based on user acl.
2. Make simple batch to all user
#WALLPAPER.bat
@echo off
reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v WallPaper /t REG_SZ /d C:\temp\wallpaper.jpg /f
3. Create Scheduled Job (taskschd.msc)
Create task
* General Tab : Type "Name" / Check 'Run with highest privileges'
* Triggers Tab : New > At log ong / Select 'Any user'
* Action Tab : New > Start a program / C:\temp\wallpaper.bat
Done.
4. Test several situations.
a. gpupdate /force
b. lock and unlock screen
c. reboot PC
d. switch user
etc.