RD Web Access – Automate Bing Wallpaper integration


Update 01/19/2015: Added link to powershell script for Bing Wallpaper download

In a recent project a customer asked to change the default Web Access background. Not just to a static image by replacing the default image, but the customer wanted the background to reflect the current Bing wallpaper, since the Bing wallpaper changes every day.
After explaining that this might be a legal issue, and the customer must contact the Bing team and his legal department to confirm that we are allowed to do this, I started doing some research.

All legal things aside (and I take no responsibility whatsoever), here’s my solution.

On a side note, I’m installing / configuring everything on the RD Web Access server itself. You can use any other server, but you need to configure some things differently if you choose not to install it on the RD Web Access server, but I leave that to you.

Download the Visual C++ 2010 x86 Redistributable here and install it. This is a pre-requisite for the tool I’m about to install.
Download the PyBingWallpaper tool here and install it:

26 RDS Web Access background 01
Only select the main program and a country of your choice. I prefer to use USA.

After installation browse to the installation folder and open “settings.conf”.

Change
setter = win
into
setter = no

Change
output_folder = C:\Users\Administrator\MyBingWallpapers
into
output_folder = C:\Windows\Web\RDWeb\Pages\images

Note that you can also set Proxy settings here if need be.
Save your changes.

Now, when running the tool’s executable it will output a file named “wallpaper.jpg”. Since the Bing wallpaper changes once a day, we need to run the tool at least once a day to meet the customer’s goal.

Create a Scheduled task using Task Scheduler (under Administrative Tools) for this.

26 RDS Web Access background 02
Run whether user is logged on or not (always run). Run with highest privileges (we need to be able to write the “wallpaper.jpg”). In this example I run the task in the Domain Administrator context. Remember this is not best practice. Instead create a user for this purpose and assign it just the right amount of rights to run this task.

26 RDS Web Access background 03
I choose to run it all day, each hour. Create a schedule that fits your needs.

26 RDS Web Access background 04
Of course we want a program to run. Browse to the PyBingWallpaper installation folder and select “BingWallpaper-cli.exe”. This is the commandline tool that gets the Bing wallpaper and stores it as “wallpaper.jpg” in the location you specified in “settings.conf” earlier.

Now we need to tell RD Web Access to use “wallpaper.jpg”.

As always, backup the files in %windir%\Web\RDWeb\Pages, just in case..
Open tswa.css from C:\Windows\Web\RDWeb\Pages\en-US in an editor.

Replace line 27 with the following code:

background-image: url(../images/wallpaper.jpg);

And just before line 31 insert the following code:

background-size: cover;

The result must look like this (showing line 26 to line 37):
26 RDS Web Access background 05

And that’s it.

Run your Scheduled Task and reload the RD Web Access interface:
26 RDS Web Access background 06
26 RDS Web Access background 07

Voila, automated Bing Wallpaper in RD Web Access.

Again, still not sure if it’s legal to use the Bing Wallpapers this way, but it works.

Update 01/19/2015:
Colleague Michael Verbeek posted a solution for downloading the current Bing Wallpaper using Powershell.
You can check his article and his solution here.

Until next time,

Arjan

30+ years experience in Microsoft powered environments. Enjoy automating stuff using powershell. In my free time (hah! as if there is any) I used to hunt achievements and gamerscore on anything Xbox Live enabled (Windows Mobile, Windows 8, Windows 10, Xbox 360 and Xbox One). Recently I picked up my Lego addiction again.

Tagged with: , , , , ,
Posted in Customize, Remote Desktop, Step-by-Step guide, Windows 2012 R2
5 comments on “RD Web Access – Automate Bing Wallpaper integration
  1. Karl Solid says:

    Arjan – We are looking for an RDP webpart for Sharepoint 2013? Any ideas

    • Arjan Mensch says:

      Hi Karl,
      Unlike SP2010 / RDS, there’s no guide to use the RDS WebPart. I have looked into this extensively. If you search for this on the interwebs you’ll probably find some threads to which I’ve contributed as well.
      The only thing I can think of at the moment is building your own SP App or Webpart based on the RDS XML feed.

  2. I’ve been reading all your RDWeb posts and WOW what a great inspiration and source of knowledge! I had no idea it was possible to customize RDWeb as much as you can.

    The changes for connect to remote PC as you showed in this post https://msfreaks.wordpress.com/2014/01/30/step-by-step-customizing-rd-web-access-2012-r2-part-3/ made me think.

    Would it somehow be possible to show icons for a user to connect to only for the computer(s) where a user is marked as Primary User?
    Basically, make a dynamic query that shows or preferably generates different RDP Files for each user when they connect to their primary PCs (they can have more than 1)?
    As a user might not know or remember the name of their PCs, it would be so cool to provide a connection to it automatically based on the AD attribute.

    Or worst case, I can pre-create the RDP files if we can show only the userspecific.rdp files that’s in for example c:\rdpfiles\%username%\files
    But would of course be better to have a dynamic AD query.

    Whats your thought on that?

    • Arjan Mensch says:

      Hi Markus,
      I haven’t thought of that option up till now, and I must say, thinking about it, it would be very much possible to do a query based on the logged on user.
      I will put it on my to-do list, but don’t hold your breath, life is swamped at the moment..

      Cheers!

  3. Autumn Palmer says:

    How do you deal with the end user devices caching the background? I tried setting the response header to expire the web content, but that doesn’t stop browsers from using the cached background.

Leave a comment

Blog Authors
https://paypal.me/ArjanMensch
BTC:1AiAL6QDbfNPiduYYEoy3iNS2m6UKJW2He

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 443 other subscribers
Blog Stats
  • 3,883,926 hits
  • An error has occurred; the feed is probably down. Try again later.
  • An error has occurred; the feed is probably down. Try again later.