Function Set-WallPaper { param ( [parameter(Mandatory=$True)] # Provide path to image [string]$Image, # Provide wallpaper style that you would like applied [parameter(Mandatory=$False)] [ValidateSet('Fill', 'Fit', 'Stretch', 'Tile', 'Center', 'Span')] [string]$Style ) $WallpaperStyle = Switch ($Style) { "Fill" {"10"} "Fit" {"6"} "Stretch" {"2"} "Tile" {"0"} "Center" {"0"} "Span" {"22"} } If($Style -eq "Tile") { New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value $WallpaperStyle -Force New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name TileWallpaper -PropertyType String -Value 1 -Force } Else { New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value $WallpaperStyle -Force New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name TileWallpaper -PropertyType String -Value 0 -Force } Add-Type -TypeDefinition @" using System; using System.Runtime.InteropServices; public class Params { [DllImport("User32.dll",CharSet=CharSet.Unicode)] public static extern int SystemParametersInfo (Int32 uAction, Int32 uParam, String lpvParam, Int32 fuWinIni); } "@ $SPI_SETDESKWALLPAPER = 0x0014 $UpdateIniFile = 0x01 $SendChangeEvent = 0x02 $fWinIni = $UpdateIniFile -bor $SendChangeEvent $ret = [Params]::SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, $Image, $fWinIni) } #Create MSIntune Folder at C:\Windows\Web\Wallpaper\ New-Item -Path 'C:\Windows\Web\Wallpaper\MSIntune' -ItemType Directory -Force #Download MSIntune WallPaper from Blob storage to C:\Windows\Web\Wallpaper\MSIntune #WallPaper MSIntune 1 $NDW1 = "Your Blob Storage Link" $wc1 = New-Object System.Net.WebClient $wc1.DownloadFile($NDW1, "C:\Windows\Web\Wallpaper\MSIntune\wp1.png") #WallPaper MSIntune 2 $NDW3 = "Your Blob Storage Link" $wc3 = New-Object System.Net.WebClient $wc3.DownloadFile($NDW3, "C:\Windows\Web\Wallpaper\MSIntune\wp2.png") #WallPaper MSIntune 3 $NDW4 = "Your Blob Storage Link" $wc4 = New-Object System.Net.WebClient $wc4.DownloadFile($NDW4, "C:\Windows\Web\Wallpaper\MSIntune\wp3.png") #WallPaper MSIntune 4 $NDW5 = "Your Blob Storage Link" $wc5 = New-Object System.Net.WebClient $wc5.DownloadFile($NDW5, "C:\Windows\Web\Wallpaper\MSIntune\wp4.png") #WallPaper MSIntune 5 $NDW1 = "Your Blob Storage Link" $wc1 = New-Object System.Net.WebClient $wc1.DownloadFile($NDW1, "C:\Windows\Web\Wallpaper\MSIntune\wp5.png") #Apply wallpaper Set-WallPaper -Image "C:\Windows\Web\Wallpaper\MSIntune\wp1.png" -Style Stretch -ErrorAction SilentlyContinue Set-WallPaper -Image "C:\Windows\Web\Wallpaper\MSIntune\wp2.png" -Style Stretch -ErrorAction SilentlyContinue Set-WallPaper -Image "C:\Windows\Web\Wallpaper\MSIntune\wp3.png" -Style Stretch -ErrorAction SilentlyContinue Set-WallPaper -Image "C:\Windows\Web\Wallpaper\MSIntune\wp4.png" -Style Stretch -ErrorAction SilentlyContinue Set-WallPaper -Image "C:\Windows\Web\Wallpaper\MSIntune\wp5.png" -Style Stretch -ErrorAction SilentlyContinue #Apply Automatic Windows Accent color $RegPath = "HKCU:\Control Panel\Desktop" $AutomaticAccent = @{ Key = 'AutoColorization'; Type = "DWORD"; Value = '1' } If ($Null -eq (Get-ItemProperty -Path $RegPath -Name $AutomaticAccent.Key -ErrorAction SilentlyContinue)) { New-ItemProperty -Path $RegPath -Name $AutomaticAccent.Key -Value $AutomaticAccent.Value -PropertyType $AutomaticAccent.Type -Force } Else { Set-ItemProperty -Path $RegPath -Name $AutomaticAccent.Key -Value $AutomaticAccent.Value -Force }