Change Local GPO using PowerShell


Recommended Posts

Greetings,

 

I am attempting to create a powershell script that will move files onto the computer from a network location and then set them as defaults using local GPO. Normally I have been doing this manually i just think this will speed things along.

 

I am moving a Default Wallpaper, Default Lock Screen Background, and 2 user images (Guest and User)

 

I have the scripts to move the files however, i am unsure how to script the changes to GPO?

 

 

Here are the Group Policy Objects I want to change.

 

LCP\Computer Configuration\Administrative Templates\Control Panel\User Accounts\Apply the default user logon picture to all users (Enable)

LCP\Computer Configuration\Administrative Templates\System\Logon\Always use custom logon background (Enable)

LCP\User Configuration\Administrative Templates\Desktop\Desktop\Desktop Wallpaper (Enabled and set to C:\windows\web\wallpaper\Default.bmp)

 

Anyone have an idea as to how to do this?

Link to comment
https://www.neowin.net/forum/topic/1242180-change-local-gpo-using-powershell/
Share on other sites

you wouldn't use a gpo for that you would change it in the registry.  You can have the script run at logon that would change this, you can even have the script copy it and then modify the registry. 

 

For logon picture:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

UseDefaultTile=1

 

Change this file to whatever file you want, keeping the filename the same

C:\ProgramData\Microsoft\User Account Pictures\user.bmp

 

For logon background:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background

OEMBackground=1

 

Place image here (file needs to be below 250KB):

C:\Windows\System32\oobe\info\backgrounds

name it "backgroundDefault.jpg"

 

Desktop Wallpaper:

HKCU\control panel\desktop

Wallpaper=c:\where_ever_the_location_of_the_file\filename.jpg

 

If you need help creating a vbscript or a kixscript let me know.  gpo just makes a point and click interface to registry keys (in most cases anyway).

In addition to the above, you can set the default background image at HKEY_USERS\.DEFAULT\Control Panel\Desktop\Wallpaper, string value with full path to the background image, but note that only will apply to newly created accounts, existing users will already have a different value set. Also note that the default user image won't be applied until a new user logs in for the first time if I remember right, won't show on the login screen properly until after that.

If you really want to go the GPO route via a desktop edition note that you'll need to install RSAT to have the groupolicy module available.. but agree with sc302, registry is much easier in this case. But here's a writeup on it regardless: http://technet.microsoft.com/en-us/library/ee461027.aspx

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • One can also use fastFetch. Gives you a quick hardware spec in a CMD or PowerShell console: https://imgur.com/a/fastfetch-kC0E3xT
    • Looking back at your message, you mention "less harsh terms." If by that you mean that requiring the pentagon to pass an audit is harsh, then to that I would say, that was already passed into law back in 1990. I wasn't planning to debate if that law was reasonable or not. If you are calling it harsh, then that is your opinion and we can disagree, but our options matter little considering it passed long ago. If you don't think the law itself is harsh, then I really can't understand how a reasonable enforcement of said law could be considered harsh either.
    • I have a strong feeling more than one store did that, and idk who is to blame more, Nintendo's terrible choice of packaging layout, or the sellers. I can't wait to see some class action lawsuit if Nintendo or said retailer doesn't step up. The question is what wonderful name we can come up with for the thing. Screengate(Staingate) already happened with Apple, so that's taken.
    • I'm definitely like this. I carry my rucksack everywhere with me and feel quite naked without it on my back. What if I need my laptop? What if the guys want to play a game of Magic? What if I need a plaster, or rubber gloves? Or my lockpicks and binoculars? Or my chessboard set? Or my portable power bank for my phone? I can't go anywhere without it, it's a life saver.
    • Bethesda's Deathloop is free to claim on the Epic Games Store this week by Pulasthi Ariyasinghe The Epic Games Store's Mega Sale promotion is in its final week, and that means mystery giveaways are soon ending too. For the finale, Epic Games has called in something big from Bethesda, with the Arkane-developed time loop adventure Deathloop coming in as the latest freebie for PC gamers. Alongside it, the indie adventure Ogu and the Secret Forest is also free. Developed by Arkane Lyon and published by Bethesda, Deathloop comes in touting an action-packed campaign involving plenty of time travel shenanigans. The game is set on the mysterious island of Blackreef, where two rival assassins, Colt and Julianna, are trapped in a time loop. The player, as Colt, has to figure out how to eliminate eight targets within a single day to escape the loop. Each of the assassinations can be taken care of in many ways, including stealth, traps, accidents, or simply going in guns blazing. Aside from gunplay, the title also makes use of supernatural systems very similar to the studio's Dishonored franchise, letting players teleport, go invisible, use telekinesis, and more. There is a multiplayer twist here too, where players, as Julianna, can invade the campaigns of others to take the role of the rival assassin, flipping the tables on the main character and his plans. As for Ogu and the Secret Forest, this is a 2024-released indie adventure featuring hand-drawn characters and various types of puzzles. The 2D game involves befriending characters across a fantasy land as baby Ogu, with plenty of exploration, puzzle solving, and boss battles available. The Deathloop and Ogu and the Secret Forest giveaways are now live on the Epic Games Store for all PC gamers. The promotion is slated to last until June 12, giving you seven days to claim a copy for your library permanently. While the summer mystery giveaways are ending, regular freebies will continue to arrive from the Epic Games Store. When this one comes to an end on Thursday, the SEGA-published humorous hospital simulation entry Two Point Hospital is incoming as the next giveaway.
  • Recent Achievements

    • Week One Done
      jbatch earned a badge
      Week One Done
    • First Post
      Yianis earned a badge
      First Post
    • Rookie
      GTRoberts went up a rank
      Rookie
    • First Post
      James courage Tabla earned a badge
      First Post
    • Reacting Well
      James courage Tabla earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      407
    2. 2
      +FloatingFatMan
      181
    3. 3
      snowy owl
      176
    4. 4
      ATLien_0
      171
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!