Showing posts with label Group Policy. Show all posts
Showing posts with label Group Policy. Show all posts

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.