There is a known issue that if you use a non-BMP wallpaper, for example a .jpg (jpeg), in a roaming profile using Microsoft Windows, it will not roam with the user. To resolve this I created a script that when used as a logoff script, it will enable the wallpaper to roam.
Further to this I would highly recommend that you implement the User Profile Hive Cleanup Service which is a free download from Microsoft.com. The User Profile Hive Cleanup service helps to ensure user sessions are completely terminated when a user logs off. System processes and applications occasionally maintain connections to registry keys in the user profile after a user logs off. In those cases the user session is prevented from completely ending. This can result in problems when using Roaming User Profiles in a server environment or when using locked profiles as implemented through the Shared Computer Toolkit for Windows XP.
I would also recommend that you use the Microsoft Group Policy Management Console (GPMC) as this will give you a far greater level of control over your GPO’s.
If you have found this article and code of use to you or your organisation why not send me a small donation?










Hello Matt,
Works like charm but gave a vbs error when I logged of at my SBS Server. the key HKCU\Control panel\Desktop\Original Wallpaper could be found.
I just added this key to this section with no value and the error was gone..
Anyway thanks for the vbs code
Victor
I get the same error as Victor, but I dont understand what he is saying to fix the problem. Can someone post the fixed code please?
I have now added some basic error handling to the script so it will now proceed even if the expected registry key does not exist. Simply re-download the code and do a straight swap out.
The script works great now
Cheers
I’ve been experiencing something similar, maybe it’s related or the same thing. We delete the cache copy of roaming profiles mainly because I believe they were loading too fast and explorer.exe wasn’t being loaded. The users background image defaults to a blue wallpaper. If you click on settings the wallpaper is selected and comes on after you select ok. Is this related or a totally different issue all together??
Without experiencing the issue first hand I am unable to give you a complete answer but it does seem to point to another issue you might have regarding the removal of cached profiles, as like you say if you view the settings and click OK it seem to work fine.
Yea, you were right about that. It was related to the removal of cached profiles. I removed that as it was being more annoying than helpful. I replaced it with the turn off fast logon (always wait fof the nework at startup). This produced the affect I was trying to get. Too often the profile would log on too fast and explorer wasn’t getting loaded.
I will try the script you have for the roaming profiles portion of the wallpaper. I know if someone moves around the picture often doesn’t stay. That is applied on the user setting, logon/logoff?
I recommend that you run the script as part of the logoff process.
I do not know how to apply a logon/logoff script. Do you know of a tutorial, or how to for this. I’m trying to get wall paper to roam, and would like to use your script, but I simply don’t know how to use it.
If you are using Active Directory and have Group Policies the easiest way is to place the script in %logonserver%\netlogon\ then create a GPO that calls it from the User Configuration/Windows Settings/Scripts/Logoff section.
Ok, I downloaded the script, and placed it in %logonserver%\netlogon. The file I downloaded was a .txt file, so I changed the extension to .vbs. In group policy, I added it under logoff scripts. This didn’t work for me, as the wallpaper still doesn’t roam. I’m not getting any errors. Did I need to modify the script to fit my system somehow?
I changed the extension back to .txt, and redid the process. It seems to work now, at least some times. It’s a little erratic. It seems to roam to some computers, but not others, and wallpaper seems to get lost once, and a while. I think your script is good, I may have another issue, or it just needs time to propagate. Thanks for all the help.
Hey, ever sense I started using this script, the clients work fine, but local users take forever to log off. It sits at running logoff script for literally 10 to 20 minutes before logging off. Is anyone else seeing this problem?
Not sure what you mean but are your users trying to access the logoff script from a network server when they are not connected to it? Plus don’t forget it is advisable to run User Profile Hive Cleanup Service which is a free download from Microsoft.com.
My DC is a multi-purpose server. It performs a lot of server functions. It is quite often that I log on to the DC locally, either because I am changing a configuration, or I log on as a restricted user to run a function that I don’t want running with admin rights. I am using UPHCS, but it didn’t make any difference, the hold up is not at saving settings, it’s at running log off scripts. I think I have narrowed the problem down to the DNS server address. The DC is also the local DNS server. I noticed that I have similar problems on the clients if there DNS quires are not directed to the DNS server on the DC. I have the DNS address statically set the the DC’s own IP address. It seems to work okay, as web pages will load. I tried to set the DNS address to 127.0.0.1, but Windows 2000 will not allow you to do that. No users of roaming profiles are allowed to log onto the DC locally, only the Domain administrator, and a few users that have been specifically set up for this purpose. Is there a way to exclude these users from running the log off script?
Excluding certain users from executing a log off script is actually quite a simple task once you find out where it should be set. All you need to do is load the GPO in the Group Policy Manager, select the Delegation tab, then the Advanced button. Now ‘Add’ in any excluded Groups or Users and set the ‘Apply Group Policy’ permission for them to Deny.
Hmmm. I cant seem to find that delegation tab. I’m opening the group policy object, the same way I did to set up the script. How do I get to the delegation tab?
The delegation tab can be found from within the Group Policy Management application once you have selected your policy. It appears in the right-hand window along with the Scope, Details and Settings tabs.
Thanks for your help Matt, but I’m missing a concept here. I guess that I don’t know what the Group Policy Management application is. Here is how I get to it. First I open Active Directory Users and Computers. Then I right click on my Domain, and select properties. Next I click on the Group Policy Tab. I only have one group policy object link. If I select it, and then click edit, this is where I was able to set up the log off script, but I don’t know how to get to the delegation tab from here.
I would also recommend that you use the Microsoft Group Policy Management Console (GPMC) as this will give you a far greater level of control over your GPO’s. See addition to my original posting.
Ok, I was getting an error “cannot find Desktop Wallpaper.vbs” so I changed the file name to “DPWP.vbs” and the error went away (my guess is the space in the name was causing the error)… but I’m still having the same problem.
It will change the wallpaper in the Display Properties / Desktop tab, but it won’t display the wallpaper, just a blue background.
Here’s what I do to check the fix:
Log on to computer A, change the wallpaper, logoff…
Log on to computer B, see blue background, confirm wallpaper was changed in Display Properties / Display Tab (and so far it will change the name but not apply the change)
Logoff computer B
Logon computer A, wallpaper is correct and being displayed. Change background, apply and log off.
Log on to computer B, correct wallpaper is listed in the display properties, but again, only a blue background is being displayed for the wallpaper.
How can I be sure the vbs script is running? I do see the “running logoff script” when I logoff.
I check the logs and have no errors; in fact I’ve cleared up quite a bit of unrelated errors to get a “clean” sys and app log upon logon and logoff.
Thanks for all your Help.
Kelly, the only thing I can suggest is to make sure that you are running the User Profile Hive Cleanup Service.
If this is the case and it is still giving you some issues let me know and I will try to help.
Hi Matt,
I’d just like to say thanks for this logoff script. It’s solved the problem I had…. for a long while I didn’t think it was working properly, but it does…. I found that if I changed the background on one machine, logged off, and logged on another immediately it didn’t pick up the changes, waiting 10seconds and logging back in it did pick it up…. any ideas why!?!?!?! Anyway it works, so thanks.
John
Hi Matt, thanks a lot for the script.