Jump to content

Set specific Windows 10 Accent Colour via GPO / REG


Recommended Posts

Posted

Im going to open a fresh one for this, I cant believe there isnt a solution to this that I have found, ive spent all day on this and done some research and not found anything that will work.

 

You can change the colour manually within windows and it works, but I cannot see how to automate this with a GPO or script etc.

 

From using process monitor when the accent is changed in windows the values are added here under the current users SID

 

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SystemProtectedUserData\SID\

 

I cant see of any other way to do this globally for the Machine, how have you guys made the logon screen a particular colour along with the Start bar etc. Surely this must be do-able.

 

Thanks

 

Scorpz

Posted

Spent a lot of the day on this again and playing with other Registry keys to some in the DWM Key both:

 

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\DWM

 

Why is this so difficult to do.... surely there is a way to do, how have you guys adjusted your corporate / school colours?

 

Cheers

 

S

Posted

Have you tried exporting the theme file. and then setting that theme?

 

I set a theme file via the registry during OSD, but we use blue so may not have changed that bit.

Posted

Just had a read around, not sure custom themes can be used as the Microsoft ones are Signed and the custom one wont so may not import by whatever means? Can anyone confirm this, or anyone who has used custom themes and used GPO or REG to import them ?

 

Cheers

Posted

Ok here is the reg key I use

 

REG ADD "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /v InstallTheme /d "%SystemRoot%\resources\Themes\school.theme" /t REG_SZ /f

 

I copy my theme file into the system themes folder, this is done during OSD imaging process.

 

I found myself needing to change the theme for a user after an upgrade from Windows 8 because the settings were different and it looked terrible.

 

For an upgrade I copy the theme file into the themes folder, but I also copy over a compiled auto hotkey script and a shortcut to it in the users startup folder.

 

Here is the script

 

sleep 30000
Run, %systemroot%\Resources\Themes\school.theme
;WinWaitActive, Personalization
WinWaitActive, Settings
sleep 1000
;WinClose, Personalization
WinClose, Settings
run, %comspec% /c "del /Q "%userprofile%\appdata\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\schooltheme.lnk""

 

 

I use blue so I'm not 100% sure the accent is part of the theme put worth a try.

I've not come across anything about themes needing to be signed. This has worked for me on 1511,1607 and now 1703.

  • Thanks 1
Posted

For testing you won't need the script, just double click the theme file.

The script opens the theme file as the logged in user and closes the window when done.

 

If you are doing this during OSD skip the script and use the installtheme reg key.

However it doesn't change the theme for existing users that's why I made the script.

  • Thanks 1
Posted

Ok thanks will play around with this, how are you setting your Theme then exporting the them file, i just see a save for sharing and saves it as a .deskthemepack file and not a .theme

 

I was hoping we could tweak the theme file then export and give it a name like School Theme, so when it imports we know its the right one.

 

Any ideas or points, cheers.

Posted (edited)

Ok, just found it can be taken from the User Profile who has amended the theme, then you can change the theme like an INI file:

 

https://msdn.microsoft.com/en-us/library/windows/desktop/bb773190(v=vs.85).aspx

 

Did you apply your background here or via GPO, does one write over the other?

 

Going to have a play with them now, but any things to watch out for when amending the theme ?

 

So the reg script only works on a new computer or users that are new on that computer ?

 

Finally you copy the them and an lnk file pointing to the theme in the users startup, then the script runs opening it and selecting it then closing and then deleting the startup shortcut ?

 

Cheers.

Edited by Scorpio
Posted

From your last post I'm guessing you got this working now?

I forgot, but yeah I got the theme file from the user profile.

I apply the background in the theme and it is copied to the correct location via my branding script during OSD.

I did not change the theme via the ini file. I made the changes in the gui then save as school name. Then that put a theme in my own profile called school.theme.

 

Hope that clears it up.

Posted (edited)

Still trying to get this to work machine wide, as the login screen seems to remember the colour from the last logged on user, so trying to use loopback GPO to apply user settings to the machine.

 

Also is this path correct ? HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes

Edited by Scorpio
Posted

Looks about right, I think you have an extra space in version though.

 

If the theme is applying then its the correct key. It may remember the last user's colors I usually don't see the log in screen once they are deployed. I'll have to make a point to go look at one.

Posted (edited)

Ive looked there is no such Key, looks to be this one.

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes

 

Also looks like you cannot prevent the users changing the theme either as it wont apply the change, so users can change the theme afterwards.

 

I cant believe they have made it so difficult to brand your Windows with your Corporate / School Colours.

Edited by Scorpio
Posted

I cant get it working for the default user using the InstallTheme registry entry, it doesnt seem to work even for new users, are you saying if this entry is in and the theme exists if a new profile is loaded on that computer it should use the theme specified ?

 

Can you check your setup / Config, would be greatly appreciate as im pulling my hair out here. :)

 

Cheers.

Posted

I see where I went wrong, I grabbed just a snip from my branding script.

I load the default user ntuser.dat into the registry add that key and unload it.

 

 

I can post up my entire branding script tomorrow if you like.

 

I found an accent color GPO today. at home now so this is a rough guess of the path.

computer > admin temps > control panel > personalize.

 

forced start menu background color and accent.

I tried to set it but it didn't seam to work, but if I set it to 0's it forced the log on screen color to the default blue.

 

Without the policy, or with custom colors set it remembered the last users accent color.

Although the policy did say Windows 8.1/2012r2 only.

Posted

Yes that would be great thanks.

 

What i have done is set the themes then copied into the folder on C:\ and use that ThemeSwitcher app as a logon script which works for already logged in users with profiles and I just get it to change the colours, funnily enough you can still use the GPO to stop theme change which stops users picking another and the little app still changes the theme, the only thing you cant enable is any GPO that prevents changesyou want the theme to change such as prevent change of colour GPO, ive had to leave that off, so users can change the colours but when they log back in the theme reapply and changes it back...

 

Next is I want to apply to any local or new users which is why im trying what you originally said, so trying to get that working....

 

Ive read dropping an oem.theme somewhere the computer (Maybe the resources/themes folder and should load this first when a new user logs in and used by dell and acer etc, i havent tried this yet or found much info on it.

Posted

Here it is in full. There are a few items such as defender first run and set search that are not strictly branding, but need to modify the default user hive so I put them in here too.

 

A few items to watch out for in this script are;

1. the osdisk variable, it behaves differently if your in a TS or not. I have a second similar script that is for upgrades, this is my OSD version.

2. copying of some of the images, you only get proper permission / access if done during OSD.

3. the forum doesn't always format things correctly. I've had to put in a few returns where it wrapped lines. Looks ok now but check for that if you get errors.

#===Start Script===
$OSDISK=$env:OSDISK
$logfile = "$OSDISK\brandingcmd.log"
Start-Transcript -Path "$OSDISK\branding.log" -Verbose
$Wallpaper = "school.jpg" "Load Default Hive" >> $logfile
REG LOAD HKLM\DEFAULT $OSDISK\Users\Default\NTUSER.DAT >> $logfile
# copy the OEM bitmap
If (-not(Test-Path $OSDISK\windows\system32\oobe\info\backgrounds)){New-item $OSDISK\windows\system32\oobe\info\backgrounds -type directory}
copy-item $PSScriptRoot\user.png "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
copy-item $PSScriptRoot\user-192.png "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
copy-item $PSScriptRoot\user-48.png "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
copy-item $PSScriptRoot\user-40.png "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
copy-item $PSScriptRoot\user-32.png "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
copy-item $PSScriptRoot\guest.png "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
copy-item $PSScriptRoot\user.bmp "$OSDISK\ProgramData\Microsoft\User Account Pictures"
copy-item $PSScriptRoot\guest.bmp "$OSDISK\ProgramData\Microsoft\User Account Pictures" 
Move-Item  "$OSDISK\Windows\Web\Screen\img100.jpg" "$OSDISK\Windows\Web\Screen\img100-1.jpg" -Force
copy-item $PSScriptRoot\$Wallpaper "$OSDISK\windows\system32\oobe\info\backgrounds\backgroundDefault.jpg"  -Force
copy-item $PSScriptRoot\$Wallpaper "$OSDISK\Windows\Web\Screen\img100.jpg" -Force
copy-item $PSScriptRoot\$Wallpaper "$OSDISK\Windows\Web\Wallpaper\Windows\$wallpaper" -Force
"Defender first run" >> $logfile
REG ADD "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows Defender" /v UIFirstRun /d 0 /t REG_DWORD /f >> $logfile

"OEM Background" >> $logfile
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background" /v OEMBackground /d 1 /t REG_DWORD /f >> $logfile
Copy-Item $PSScriptRoot\school.theme "$OSDISK\Windows\Resources\Themes" -Force
Copy-Item $PSScriptRoot\schooltheme.exe "$OSDISK\Windows\Resources\Themes" -Force
"Set Theme " >> $logfile
REG ADD "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /v InstallTheme /d "%SystemRoot%\resources\Themes\school.theme" /t REG_SZ /f >> $logfile
"Set Search" >> $logfile
reg add HKLM\default\software\Microsoft\Windows\CurrentVersion\search /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f >> $logfile
[gc]::Collect() # necessary call to be able to unload registry hive
"unload hive" >> $logfile
REG UNLOAD HKLM\DEFAULT >> $logfile
Stop-Transcript

  • Thanks 1
Posted

Will have to try, this is smaller school that dont have images so need to have ways of doing this for the Default user on computers out of the box with Windows 10 Pro on.

 

We have it sorted on users that already have profiles using a theme file and the Theme switcher, but just need to work out how to do it for default user.

 

Cheers

Posted

As I stated earlier, you need to modify the default users ntuser.dat file.

 

This should be the minimum you need to do in a TS.

 

$OSDISK=$env:OSDISK
REG LOAD HKLM\DEFAULT $OSDISK\Users\Default\NTUSER.DAT 
Copy-Item $PSScriptRoot\school.theme "$OSDISK\Windows\Resources\Themes" -Force
REG ADD "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes" /v InstallTheme /d "%SystemRoot%\resources\Themes\school.theme" /t REG_SZ /f 
[gc]::Collect() 
REG UNLOAD HKLM\DEFAULT

  • Thanks 1
  • 1 month later...
Posted (edited)

Ok

 

Played a little more with this and the script injecting into the default hive, it copys and lists the theme but doesnt select it ? so it isnt the selected Theme,

 

whats this line ? Is this copying the themewitcher app ? I dont see any other code relating to it, is this done with the logon script ?

 

Copy-Item $PSScriptRoot\schooltheme.exe "$OSDISK\Windows\Resources\Themes" -Force

 

Also Explain a little more about this line? As looking to do the backgrounds etc also.

 

If (-not(Test-Path $OSDISK\windows\system32\oobe\info\backgrounds)){New-item $OSDISK\windows\system32\oobe\info\backgrounds -type directory}

 

Also what is the path for the default background wallpaper so this loads on new user or local user in the Default Hive, i know there a few places. ?

 

Also is some elements of the long script for Windows 7 as well?

 

Many Thanks.

Edited by Scorpio
Posted

The if statement with oobe is basically saying if this folder does not exist create it. A few lines down from that a line to copy the background into the newly created folder.

This may be a leftover from Windows 7, I'm not 100% it is still needed.

 

The line to copy the theme.exe is to put it in a location anyone can run it. It is for the upgrade to change an existing users theme to the upgraded default. The exe is a compiled auto hot key script code for it posted in #6

 

The default wall paper / lock screen is the lines with img100.jpg, I've just updated the script in 1709 the lock screen is img103.png.

The script moves / renames the default img out of the way and replaces it with my background image.

 

I'm not sure why it isn't working for the default user, that was the easy part for me. I had trouble getting existing users to switch.

 

Are you adding the reg entry install theme pointing at the .theme file copied from the previous step?

Posted

Managed to get this all to work how we want it as best possible. Using snippets of this thread and the ThemeSwitcher app, which is great.. Its such a task to get Windows 10 how you want it and then they mess it up at each Update. Im sure we will be revisiting this at some point!!

 

Thanks All, Especially AD Master. Cheers !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...