Sei sulla pagina 1di 7

How-To Geek

Use BGInfo to Build a Database of System Information of Your Network Computers

One of t he more popular t ools of t he Sysint ernals suit e among syst em administ rat ors is BGInfo which t acks real-t ime syst em informat ion t o your deskt op wallpaper when you first login. For obvious reasons, having informat ion such as syst em memory, available hard drive space and syst em up t ime (among ot hers) right in front of you is very convenient when you are managing several syst ems. A lit t le known feat ure about t his handy ut ilit y is t he abilit y t o have syst em informat ion aut omat ically saved t o a SQL dat abase or some ot her dat a file. Wit h a few minut es of set up work you can easily configure BGInf o t o record syst em informat ion of all your net work comput ers in a cent ralized st orage locat ion. You can t hen use t his dat a t o monit or or report on t hese syst ems however you see fit .

BGInfo Setup
If you are familiar wit h BGInfo, you can skip t his sect ion. However, if you have never used t his t ool, it t akes just a few minut es t o set up in order t o capt ure t he dat a you are looking for. When you first open BGInfo, a t imer will be count ing down in t he upper right corner. Click t he count down but t on t o keep t he int erface up so we can edit t he set t ings.

Now edit t he informat ion you want t o capt ure from t he available fields on t he right . Since all t he out put will be redirect ed t o a cent ral locat ion, dont worry about configuring t he layout or format t ing.

Configuring the Storage Database

BGInfo support s t he abilit y t o st ore informat ion in several dat abase format s: SQL Server Dat abase, Access Dat abase, Excel and Text File. To configure t his opt ion, open File > Dat abase.

Using a T ext File

The simplest , and perhaps most pract ical, opt ion is t o st ore t he BGInfo dat a in a comma separat ed t ext file. This format allows for t he file t o be opened in Excel or import ed int o a dat abase. To use a t ext file or any ot her file syst em t ype (Excel or MS Access), simply provide t he UNC t o t he respect ive file. The account running t he t ask t o writ e t o t his file will need read/writ e access t o bot h t he share and NTFS file permissions.

When using a t ext file, t he only opt ion is t o have BGInfo creat e a new ent ry each t ime t he capt ure process is run which will add a new line t o t he respect ive CSV t ext file.

Using a SQL Dat abase

If you prefer t o have t he dat a dropped st raight int o a SQL Server dat abase, BGInf o support t his as well. This requires a bit of addit ional configurat ion, but overall it is very easy. The first st ep is t o creat e a dat abase where t he informat ion will be st ored. Addit ionally, you will want t o creat e a user account t o fill dat a int o t his t able (and t his t able only). For your convenience, t his script creat es a new dat abase and user account (run t his as Administ rat or on your SQL Server machine): @SET Server=%Comput erName%. @SET Dat abase=BGInfo @SET UserName=BGInfo

@SET Password=password SQLCMD -S %Server% -E -Q Creat e Dat abase [%Dat abase%] SQLCMD -S %Server% -E -Q Creat e Login [%UserName%] Wit h Password=N%Password%, DEFAULT_DATABASE=[%Dat abase%], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF SQLCMD -S %Server% -E -d %Dat abase% -Q Creat e User [%UserName%] For Login [%UserName%] SQLCMD -S %Server% -E -d %Dat abase% -Q EXEC sp_addrolemember Ndb_owner, N%UserName%

Not e t he SQL user account must have db_owner permissions on t he dat abase in order for BGInfo t o work correct ly. This is why you should have a SQL user account specifically for t his dat abase.

Next , configure BGInfo t o connect t o t his dat abase by clicking on t he SQL but t on.

Fill out t he connect ion propert ies according t o your dat abase set t ings.

Select t he opt ion of whet her or not t o only have one ent ry per comput er or keep a hist ory of each syst em.

The dat a will t hen be dropped direct ly int o a t able named BGInfoTable in t he respect ive dat abase.

Configure User Desktop Options

While t he primary funct ion of BGInfo is t o alt er t he users deskt op by adding syst em info as part of t he wallpaper, for our use here we want t o leave t he users wallpaper alone so t his process runs wit hout alt ering any of t he users set t ings. Click t he Deskt ops but t on.

Configure t he Wallpaper modificat ions t o not alt er anyt hing.

Preparing the Deployment

Now we are all set f or deploying t he configurat ion t o t he individual machines so we can st art capt uring t he syst em dat a. If you have not done so already, click t he Apply but t on t o creat e t he first ent ry in your dat a reposit ory. If all is configured correct ly, you should be able t o open your dat a file or dat abase and see t he ent ry for t he respect ive machine.

Now click t he File > Save As menu opt ion and save t he configurat ion as BGInfoCapt ure.bgi.

Deploying to Client Machines

Deployment t o t he respect ive client machines is pret t y st raight forward. No inst allat ion is required as you just need t o copy t he BGInfo.exe and t he BGInfoCapt ure.bgi t o each machine and place t hem in t he same direct ory. Once in place, just run t he command: BGInfo.exe BGInfoCapt ure.bgi /Timer:0 /Silent /NoLicPrompt

Of course, you probably want t o schedule t he capt ure process t o run on a schedule. This command creat es a Scheduled Task t o run t he capt ure process at 8 AM every morning and assumes you copied t he required files t o t he root of your C drive: SCHTASKS /Creat e /SC DAILY /ST 08:00 /TN Syst em Info /TR C:BGInfo.exe C:BGInfoCapt ure.bgi /Timer:0 /Silent /NoLicPrompt

Adjust as needed, but t he end result is t he scheduled t ask command should look somet hing like t his:

Download BGInfo from Sysint ernals


Jason Faulkner is a developer and IT professional who never has a hot cup of coffee far away. Interact with him on Google+ Published 01/27/11 20,643 Views


HT G Explains: Does Plain Black Wallpaper Save Battery on Mobile Devices?

How to Batch Rename Files in Windows: 4 Ways to Rename Multiple Files

HT G Explains: What You Can (and Cant) Do on the Desktop in Windows RT

HT G Explains: Why Screen Savers Are No Longer Necessary

How to Find the Root Cause of Your Android Battery Problems

How to Reset Your Windows Password Without an Install CD