Monday, April 11, 2011

Deploy BgInfo with Group Policy

I’ve always been a fan of using BgInfo to apply a standard background on servers I manage.  BgInfo allows you to put relevant information like Name, IP, Boot Time, Disk Space, etc on your desktop.  For more information on how to use BgInfo, please visit their site.

In this article I’m going to focus on how you can deploy BgInfo to machines via Group Policy.

BgInfo requires 3 basic files:
  • Bginfo.exe – The main executable
  • Custom.bgi – Configuration file saved in Bginfo.exe.  This is where you setup what you want the desktop ground to look like.  You can name the file whatever you’d like.
  • StartBgInfo.cmd – batch file used to start Bginfo.exe and apply the info to the desktop.
  • Eula.txt (Optional) – used so the first time it doesn’t display a EULA
Since this application does not need to be installed, we can use Group Policy to deploy the files to machines we target in the Group Policy Object (GPO).  We will use the Files setting under Computer Configuration, Preferences, Windows Settings.  This GPO will require Group Policy Preferences which was introduced in Windows Vista/2008.  Preferences require some client side extensions that are available by default in Vista/2008 and later machines and can be installed on XP/2003 systems. 

You can put the source of the files wherever you’d like, as long as it is accessible to the machine that needs the files.  I like the idea of placing them in the logon scripts folder in SYSVOL (ex -  \\domain.dom\NETLOGON\BgInfo\) so that way they will be on a domain controller that is closest to the user.  (Assuming AD Sites and Services is setup correctly)

The batch file that loads BgInfo on logon (StartBgInfo.cmd) is the only file that has a hard requirement on where it needs to go.  It needs to be put in the All Users Startup folder under the Start Menu.  The other files can go wherever you’d like to put them.  I’ve chosen to put them under “C:\Program Files\BgInfo” using the system variable %ProgramFiles%.

Also, here's what I use for the contents of StartBgInfo.cmd.  For other available command line switches available for BgInfo.exe, see their documentation.

echo off
"%ProgramFiles%\BGInfo\BGInfo.exe" "%ProgramFiles%\BGInfo\BGInfo.bgi" /NOLICPROMPT /timer:0
exit

Here’s what the GPO settings look like when editing the GPO

Here's a more zoomed in version to see the source and target locations


You’ll see that StartBgInfo.cmd is in there twice.  This is because of the different location of the Startup folder in XP/2003 systems vs Vista/2008 and later systems.  I used item level targeting on those files to have them only apply to the correct systems. 

When you double click on the file in the group policy editor, you'll see the following:


Deploying BgInfo via Group Policy makes it really nice to push a consistent background image out to all machines that you target in the GPO.  It also makes it much easier to do mass updates if you need to push out a new version or update the configuration file.


11 comments:

Andrew said...

Drew,

I have a question, you mention deploying BGInfo as a computer configuration. Is there any benefit to doing that as opposed to deploying it as a user configuration?

The reason why I ask is that in a previous background wallpaper GPO we deployed, we used the User Configuration Administrative Template. Therefore, I'm wondering if we can deploy BGInfo files/configuration as a user config.

I know policy overrides preferences, but what happens when you enforce a preferenece. Does a conflicting policy still win?

Thank you for your time!
Andrew

Drew Henning said...

@Andrew. Your question regarding if you should use a Computer or User policy depends on what your requirements are. It depends on if you want to target the settings at computers or users.

If you want the BGInfo to apply to all users on a computer, then I'd target the settings at the computer objects with computer configuration.

If you BBInfo to apply to only specific users on a system, then target the policy at those users.

Also, BGInfo should just overlay itself over your existing wallpaper.

Eric said...

I don't understand how to set the preferences, i installed the update to my 2003 server and restarted group policy management and edited the policy but it doesn't show the file section you speak of.

Marco said...

Drew,

Thank you. These were amazing instructions. I appreciate it. You helped me immensely.

Concerned Irish Citizens said...

Hi Drew
I followed your instructions to the letter but it will not work. Windows 2008 R2 server.
When I run gpresult /V I can see the policy applied but no breakdown of the option performed.

Shaz-Au said...

Thanks for sharing this awesome article Drew. Your solution is a much more elegant way than the xcopy script I thought I was going to have to use!
Cheers,
Shannon

Bolsa Clothing said...

AMAZING! Worked like a charm in my mixed 2003/2008 environment! Thank you so much Drew!

Bolsa Clothing said...

I set the the bginfo.bgi action to replace in the Files Settings in the GPO... I would think Update would update it but it wasn't. The min i change the setting from Update to Replace all my boxes got the changes I made to the bginfo.bgi. Thanks again for making this so easy!!!

Chocolate Sensations said...

Works Like a Charm!!!! Thank YOU!!!

Unknown said...

Perfect instruction. Thanks Drew for your effort to put in here.

Health Care Tips said...

ITIngredients offer free IT Training on Windows Server 2012 R2, Citrix XenApp, Citrix XenDesktop, VMWare ESXi, VMWare Horizon Air. It's a one stop shop for all the queries related to IT.

deploy desktop wallpaper group policy server 2012