Sometime i write about doing some task with Powershell and that task are just a “Registry Tweaks”, and those tweaks can be done using some other methods too.
The idea behind with these post and scripts are, that when we are writing a powershell script, that will be completely powershell based.
For example if i creating an “Windows Customization ” tool and i need to configure few settings, then that tasks should be done by Powershell Not by something else.
My today task was to set Desktop Background to be a specific colour. First i was searching for how to do this using powershell and after a few minutes i have find that , that can be done by tweaking a registry key.
What we want to automate.?
we want to automate the below marked option “Change Background Colour”.
What is current background colour.?
You can see in below picture that my current desktop background in “Dark Red”.
Now lets Change the background to the “Green”.
The RGB Code for Green Colour is : 116 164 2
The Registry Key which holds the setting of background colour is “Background” located at “Hkey_Current_User\Control Panel\Colors”
Set-ItemProperty 'HKCU:\Control Panel\Colors' -Name Background -Value "116 164 2 "
Now run the above in Powershell console.
Log off from your system and login again.
and here you go :) after login back, we can see that our Desktop background colour is changed to the Green one :)
Now, change the background colour of every laptop in your organization to match with your company’s logos colour.
I hope that you will find it helpful.