There is no default GPO to set the Desktop background. We have a terminal server with a white wallpaper, however the default background is black, thus you can not read the icon’s font. To fix that, you can create an ADM template.

Save that file to your server and name it ‘backgroundcolor.adm’. Open up Group Policy Management and create a new  GPO and link it to the right OU.
Edit the GPO, go to User Configuration -> Administrative Templates, right click Administrative Templates and then Add Template

Browse to the Backgroundcolor.adm and add it in. Under Administrative Templates you will now see a custom category called “Set Background Color”

To change the colour of the desktop, select “Desktop Background Color policy”, then enable it.

Simply then enter the RGB value of the color you want.

Here’s a quick break down:

dsquery computer –inactive 8 –limit 1000
This line searches the AD for computers that have not logged in for 8 weeks or more. By default the dsquery will only look for 100 objects so we need to raise the limit.

$comp -replace ‘”‘, ”

Here we are cutting the “ character that dsquery hands the objects names over with. These are located at the start and end.

Disable-ADObject and Move-ADObject are self explanatory.
Note they do have –whatif switches that will help if you want to see whats going to happen.
Append -whatif to the end of the command.