Skip to main content

Configurer le papier peint par défaut Autopilot sur Windows 10 Pro

D'après la page précédente, il est impossible d'utiliser ce paramètre avec Windows 10, mais il est possible de faire autrement.
Tout d'abord, il nous faut un répertoire pour stocker l'image si elle n'est pas publique : blob, container, ...

Nous allons utiliser Sharepoint. On crée un site d'équipe avec une adresse du site court (pour éviter le soucis d'url trop longue Sharepoint).

image-1654897184046.png

On clique ensuite dessus et dans l'onglet "Stratégies" et "Partage externe" :

image-1654897250735.png

image-1654897303120.png

image-1654897315933.png

Il est important d'appliquer ces paramètres.

On se rend ensuite sur le SharePoint, on clique sur les paramètres et "Contenu du site".

image-1654897369192.png

On crée une application.

image-1654897398523.png

On clique sur "expérience classique".

image-1654897426982.png

On choisit "Bibliothèque d'images".

image-1654897460197.png

On lui donne un nom.

image-1654897476604.png

Si on souhaite définir un écran de verrouillage, on refait de même mais avec le nom "Lockscreens".

image-1654897517855.png

On clique sur "Wallpapers" et on rajoute notre image.

image-1654897812536.png

On sélectionne l'image puis "Partager".

image-1654897849288.png

On copie le lien et on le stocke sur un notepad (ou OneNote...).

image-1654897888356.png

On édite ensuite le script "SetDesktopBackground" pour ajouter le nom de notre tenant à la ligne 33. (Le nom du tenant est celui que vous voyez en haut à droite)

image-1654898064461.png

image-1654898031819.png

On change la variable $url pour y mettre le lien précédemment copié.

Ensuite, il faut rajouter le script dans Intune.

image-1654905474136.png

image-1654907749778.png

image-1654905903175.png

Après une ou plusieurs minutes lors de l'ouverture de la session, le papier-peint sera changé. L'utilisateur pourra toujours le changer.

<# 
.SYNOPSIS
Allows you to set the backgroup on a Windows 10 device that isn't just Windows 10 Enterprise using Microsoft Intune

.DESCRIPTION
This script set background image using Microsoft Intune SideCar/Client PowerShell feature.

For what every reason Microsoft has restricted the Microsoft Intune CSP setting "DesktopImageUrl"
to Windows 10 Enterprise. The setting was introduced as part of the Personalization CSP in Windows 10 version 1703.
Several of my customers have enterprise edition but I also have some that only have Windows 10 Pro.

Some of the customers that have Windows 10 Enterprise, but upgrades from Windows 10 Pro as part of the Windows 10 Enterprise E3
license see that the background policy doesn't apply as expected or sporadic. I'm not sure whether this is
caused by a conflict or the fact that the "DesktopImageUrl" setting doesn't get re-applied after the upgrade
I am not sure. It does not seems to work as the customers expect, which should be the goal of this property.

For more information about the Windows 10 personalization CSP policy see this article:
https://docs.microsoft.com/da-dk/windows/client-management/mdm/personalization-csp

.NOTES
Author: Peter Selch Dahl from APENTO ApS
Website: http://www.APENTO.com
Last Updated: 11/17/2018
Version 1.0

#DISCLAIMER
The script is provided AS IS without warranty of any kind.

#>

#Open the folder en Windows Explorer under C:\Users\USERNAME\AppData\Roaming\CustomerXXXX
########################################################################################
$path = [Environment]::GetFolderPath('ApplicationData') + "\CustomerXXXX"

If(!(test-path $path))
{
New-Item -ItemType Directory -Force -Path $path
}
########################################################################################


#Download the image from ImGur to user profile
########################################################################################
$url = "https://khroners.sharepoint.com/:i:/s/Intune/EXzIhLhr28RAjLW9wN26OyIBk4VztSLP9Davs-78x7Uctw?e=Icgafq"
$output = $path + "\wallpaper.png"
$userdefined = Get-ItemProperty -Path "HKCU:\Control Panel\Desktop\" -Name "wallpaper"
if ($userdefined.wallpaper -ne $output) {
exit
}
Start-BitsTransfer -Source $url -Destination $output

########################################################################################

# Update the background of the desktop
########################################################################################
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $output

rundll32.exe user32.dll, UpdatePerUserSystemParameters

########################################################################################

L'utilisateur pourra toujours changer le fond d'écran. Si vous changez le script et l'image, et que l'utilisateur a choisi son propre fond d'écran, le nouveau ne sera pas mis en place. Si vous souhaitez le changer, retirez les lignes 46 à 49.

Le script ne s'exécutera qu'une seule fois. Si vous souhaitez le relancer sur tous les appareils, il faut réimporter le script dans Intune.