![]() You should now see your Bing image (with the description) set as the logon and default background. With all of that done, run a GPUpdate and reboot the computer. This registry key is only need for Windows 7 clients so use an ILT to applies this key to just that operating system. įinally, configure a Registry preference under Computer Configuration matching the image below. The source should be C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg and the Target should be C:\Windows\Web\Wallpaper\Windows\img0.jpg. The third preference also uses a Replace action. The target location for both preferences should be: C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg. ![]() For both, the source should point to the JPG location that you entered for the $saveLocationWithDescriptionAdded variable. The first preference uses a Create action and the second preference uses a Replace action. In the same GPO, create three new File Preferences under Computer Configuration. Set the value to: C:\windows\system32\oobe\info\backgrounds\backgroundDefault.jpg Next, navigate to Administrative Templates\Control Panel\Personalization and enable Force a specific default lock screen and logon image. Under Computer Configuration\Policies\Windows Settings\Security Settings\File System, add a new entry for %SystemRoot%\Web\Wallpaper\Windows\img0.jpg and copy the permissions from the picture below. Using Group Policy to Sync the Bing ImageĬreate a new GPO for your Bing Image configuration and link it to an OU containing computers. Images and titles are now pulled directly from Bing instead of a 3rd party RSS feed.Thanks for Andrew for finding that problem! Able to run script multiple times in the same window.Disable the two lines under #Converts Font Color to Black or White to restore funky colors Chooses either black or white for text font.Accurately finds average background color of text regardless of text length.The text title color will change to contrast with the average color behind it. You should see that same image along with the image description saved to the file path specified in the second variable. You should see the current image from saved to the file path specified in the first variable. $bmpFile.Save($savelocationwithdescriptionadded,::JPEG)Īdd-TextToImage -sourcePath $savelocation -destPath $savelocationwithdescriptionadded -Title $Descriptionīefore continuing to the Group Policy portion, manually run the script once. $Image.DrawString($Title, $Font, $Brush, $MiddleStartingPoint, $Bottom) $Brush = New-Object Drawing.SolidBrush (::FromArgb(240,$FontColorR,$FontColorG,$FontColorB)) $Image.DrawImage($srcImg, $Rectangle, 0, 0, $srcImg.Width, $srcImg.Height, (::Pixel)) $Bottom = $srcImg.Height - $HeightfromBottom $Rectangle = New-Object Drawing.Rectangle 0, 0, $srcImg.Width, $srcImg.Height $bmpFile = new-object (($srcImg.width)),(($srcImg.height)) Write-Verbose "Create a bitmap as $destPath" Write-Verbose "Get the image from $sourcePath" ::LoadWithPartialName("System.Drawing") | Out-Null #Add Bing Image Title to lower left corner of image. $Colors = in (($Bitmap.Height-$HeightfromBottom).($BitMap.Height-($HeightfromBottom-20)))) $BitMap = ::FromFile((Get-Item $filename).fullname) #Get Average Color of bottom left corner of picture $MiddleStartingPoint = 960 - ($DescriptionPixelLength/2) $DescriptionPixelLength = ($Description.Length)*8.35 8.35 is average pixel size of a letter a 14 Ariel font. Remove-Item C:\Users\Public\title.txt -Force $Description = $Title.Replace(' $BingImage = Invoke-WebRequest -Uri $uri -SessionVariable Bing -ContentType "text/xml charset=utf-8" -Method Get Set to 75 for the text to appear above taskbar if used as desktop background. This controls how far up from the bottom that the next is written. $saveLocationWithDescriptionAdded = '\\SERVER\SHARE\Bing Background\backgroundDefault.JPG' #Location to store image with title added to it. $saveLocation = ‘\\SERVER\SHARE\Bing Background\WithoutText\backgroundDefault.jpg’ The Group Policy settings can be found below the script. Make sure that the user running the script has write permission to the path specified in your two variables. Set the script to run daily and then to repeat every hour in case the image changes during the day. Keep the file name (backgroundDefault.jpg) the same. To use this script, set the $saveLocation and $saveLocationWithDescriptionAdded variables at the top of the script. ![]()
0 Comments
Leave a Reply. |