Can we Edit the Local Computer Policy ?

Copper Contributor

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 ?

5 Replies

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

https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-obje...

-Set-ItemProperty

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?...

 

 

@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 ?

@Vinay335 

 

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?

Group Policy is under progress. checking for the workaround. So there is no direct approach to change the local computer policy directly / through script.

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.