If they match, the script detects the images are correct. The detection script creates a temporary directory, downloads the current version of the background.jpg and lockscreen.jpg from blob storage, and compares the modified timestamp on the file to the files in use on the workstation. This keeps the install and detection scripts unchanged and requires no repackaging of the Win32 app or updating of the detection script. The key here is the images used for background and lockscreen must always be named background.jpg and lockscreen.jpg as they’re replaced. So our new custom detection script was born and is available on github here and the syntax is below. This value will differ between the images as they replace the background and lockscreen images: We can look at the date and time the file was modified. That’s when I thought of using one of the file properties if we use PowerShell to look at file details: get-itemproperty -path c:\temp\images\background.jpg | FL * I needed to find something unique about these files I could use. That’s where the new custom detection script came in. Pretty simple, but now I had to determine a way to easily update these images without repacking everything. New-ItemProperty -Path $RegPath -Name DesktopImageStatus -Value 1 -PropertyType DWORD -Force | Out-Null New-ItemProperty -Path $RegPath -Name DesktopImageUrl -Value $backgroundimage -PropertyType String -Force | Out-Null New-ItemProperty -Path $RegPath -Name DesktopImagePath -Value $backgroundimage -PropertyType String -Force | Out-Null New-ItemProperty -Path $RegPath -Name LockScreenImageStatus -Value 1 -PropertyType DWORD -Force | Out-Null New-ItemProperty -Path $RegPath -Name LockScreenImageUrl -Value $LockScreenImage -PropertyType String -Force | Out-Null New-ItemProperty -Path $RegPath -Name LockScreenImagePath -Value $LockScreenImage -PropertyType String -Force | Out-Null Start-BitsTransfer -Source $LockscreenImageURL -Destination "$LockScreenimage" Start-BitsTransfer -Source $BackgroundImageURL -Destination "$Backgroundimage" Md $ImageDestinationFolder -erroraction silentlycontinue $LockScreenImage = "$ImageDestinationFolder\Lockscreen.jpg" $Backgroundimage = "$ImageDestinationFolder\background.jpg" $LockscreenImageURL = ' $ImageDestinationFolder = "C:\temp\images" $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" Basically, this creates our necessary registry key and values, downloads the images from blob storage, and uses those images for our background and lockscreen: New-Item HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP -Force So, they were easily accessible to set with this script linked below from my github. They already had the images they wanted to use on blob storage. However, this particular client was not licensed for Proactive Remediations. A proactive remediation would also be great here. The challenge here became trying to find a way to easily change these images without having to change our install script and repackage the Win32 app every time. However, they had several business units where they wanted different images deployed, and they planned on changing the images regularly. I recently had a client come to me asking about setting the wallpaper and lock screen, which is a fairly simple task by following the original post content under this section. Updated – New Custom Detection Script to update your images without updating your Win32 App
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |