Show up-to-date server info on the desktop background of all your servers

If you’re a sysadmin like me, you’ll have multiple RDP sessions to multiple servers open a the same time on occasion. They tend to look alike if you keep things standardized and this can introduce the risk of human error when it comes to maintenance. If all RDP sessions look the same, it can be easy to restart the wrong service on the wrong server. To avoid this, I’ve used BgInfo for years. It’s free to download and was designed to gather system information and displays it on the desktop background of a Windows server or workstation. It can be a helpful resource when remotely administering multiple servers. The software is an oldie but a goodie and in this tutorial, I’ll be walking through the process of creating a Group Policy Object which pushes the BgInfo executable and settings file to all servers or workstations in an Organizational Unit.

Group Policy Details:

[download] the zip of BGinfo and all files showcased in this tutorial.

Shortcut Screenshot:
bginfo-shortcut-for-deploying-bginfo-via-gpo

Target path for the shortcut: c:appsbginfobginfo.exe
Arguments for the shortcut: c:appsbginfosettingsvielmetter.bgi /SILENT /TIMER:0 /NOLICPROMPT

That’s it.

Comments

7 responses to “Show up-to-date server info on the desktop background of all your servers”

  1. winston Avatar
    winston

    Good day

    What is in the network.vbs script as that is what is missing for me could you mail me please

    Kind regard
    Winston

    1. David Vielmetter Avatar

      Here is network.vbs

      —start—
      Rem (c) 2007 Data Management & Warehousing
      Rem
      Rem A script to print network information for BGInfo
      Rem
      Rem The script tabkes advantage of the Windows Management Interface (WMI)
      Rem to acquire the Network Configuration
      Rem
      Rem This script is overly commented to allow others as a learning aid.

      On Error Resume Next

      Rem Configuration

      Rem Configuration Declarations

      Rem Which computer ? – normally . for the localhost
      Dim strComputer
      Rem Display Adaptor Name ?
      Dim blnShowCaption
      Rem Display the IP address ?
      Dim blnShowIPAddress
      Rem Display IPv6 addresses ?
      Dim blnShowIPv6
      Rem Display whether the address is a DHCP Address ?
      Dim blnShowDHCP
      Rem Display DHCP Lease expiry ?
      Dim blnShowDHCPExpire
      Rem Display the Default Gateway
      Dim blnShowGateway
      Rem Display the Default Subnet
      Dim blnShowSubnet
      Rem Display the DNS Domain
      Dim blnShowDNSDomain
      Rem End of script message
      Dim strMessage

      Rem Configuration Values

      strComputer = “.”
      blnShowCaption = True
      blnShowIPAddress = True
      blnShowIPv6 = False
      blnShowDHCP = True
      blnShowDHCPExpire = True
      blnShowGateway = True
      blnShowSubnet = True
      blnShowDNSDomain = True
      strMessage = “Script (c) 2007 Data Management & Warehousing (http://www.datamgmt.com)”

      Rem Code Block

      Rem Code Block Declarations

      Rem Identity of the Windows Management Service
      Dim objWMIService
      Rem Items within the Windows Management Service
      Dim colItems
      Rem Objects within the Items
      Rem Full list: http://msdn2.microsoft.com/en-us/library/aa394217.aspx
      Dim objItem

      Rem Current Record Values of objItems
      Dim strIPAddress
      Dim strCaption
      Dim strDHCP
      Dim strGateway

      Rem Code Block Functionality

      Rem Define source of information
      Set objWMIService = GetObject(“winmgmts:\” & strComputer & “rootcimv2”)

      Rem Define query to get information – IPEnabled restricts the information to active Adaptors
      Set colItems = objWMIService.ExecQuery(“Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = TRUE”)

      Rem Get each adaptor from the table
      For Each objItem In colItems
      Rem Get each IP address for the addaptor
      For Each strIPAddress In objItem.IPAddress
      Rem check to see if it is an IPv6 address and whether we want it
      If InStr(strIPAddress, “::”) = 0 Or blnShowIPv6 Then
      Rem Set up the correct adaptor name by stringing the first 12 characters and also the MAC address
      strCaption = fnSubstring(objItem.Caption, 12, 1024) & ” (” & objItem.MACAddress & “)”
      Rem Format DHCP info if required
      If objItem.DHCPEnabled and blnShowDHCP Then
      strDHCP = ” (DHCP”
      If blnShowDHCPExpire Then
      strDHCP = strDHCP & ” – Expires: ” & fnDisplayDate(objItem.DHCPLeaseExpires) & “; Server: ” & objItem.DHCPServer
      End If
      strDHCP = strDHCP & “)”
      Else
      strDHCP = “”
      End If
      Rem Print information
      Rem Note that any other object from Win32_NetworkAdapterConfiguration can be added here
      Call fnDisplayValue(blnShowCaption,strCaption,”Adaptor”,1)
      Call fnDisplayValue(blnShowIPAddress,strIPAddress + strDHCP,”IP Address”,1)
      Call fnDisplayValue(blnShowGateway,objItem.DefaultIPGateway,”Gateway”,1)
      Call fnDisplayValue(blnShowSubnet,objItem.IPSubnet(0),”Subnet”,2)
      Call fnDisplayValue(blnShowDNSDomain,objItem.DNSDomain,”Domain”,1)
      Echo “”
      End If
      Next
      Next

      Rem print the end of script message
      Echo strMessage

      Rem End of Programme

      Rem Procedures & Functions

      Rem Display a passed value
      Rem The parameters are:
      Rem p_valueLogical – should this value be displayed ?
      Rem p_valueVar – the value to display
      Rem p_valueDisplay – the text to Display
      Rem p_valueTab – the number of tabs needed to align it

      Sub fnDisplayValue(p_valueLogical, p_valueVar, p_valueDisplay, p_valueTab)

      Dim strVar

      If p_valueLogical Then
      Rem if the value is an array the cycle through each value
      If IsArray(p_valueVar) Then
      For Each strVar In p_valueVar
      Rem if the value is a string then display it, otherwise ignore it
      If VarType(strVar) = 8 Then
      Echo p_valueDisplay & “:” & String(p_valueTab,” “) & strVar
      End If
      Next
      Else
      strVar = p_valueVar
      Rem if the value is a string then display it, otherwise ignore it
      If VarType(strVar) = 8 Then
      Echo p_valueDisplay & “:” & String(p_valueTab,” “) & strVar
      End If
      End If
      End If

      End Sub

      Rem Function to pull the a substring out from a string

      Function fnSubstring(p_strData,p_intStart,p_intLength )

      Dim intLen
      intLen = Len(p_strdata)

      If p_intStart < 1 Or p_intStart > intLen Then
      fnSubstring = “”
      Else
      If p_intLength > intLen – p_intStart + 1 Then
      p_intLength = intLen – p_intStart + 1
      End If
      fnSubstring = Right(Left(p_strData, p_intStart + p_intLength – 1), p_intLength)
      End If

      End Function

      Rem Function to convert a WMI date stamp into a usable date

      Function fnDisplayDate(p_strDate)

      Dim strYear, strMonth, strDay, strHour, strMinute, strSecond

      strYear = fnSubstring(p_strDate,1,4)
      strMonth = fnSubstring(p_strDate,5,2)
      strDay = fnSubstring(p_strDate,7,2)
      strHour = fnSubstring(p_strDate,9,2)
      strMinute = fnSubstring(p_strDate,11,2)
      strSecond = fnSubstring(p_strDate,13,2)
      fnDisplayDate = cdate(strMonth & “/” & strDay & “/” & strYear & ” ” & strHour & “:” & strMinute & “:” & strSecond)

      End Function

      Rem End of file
      —end—

  2. Darren Avatar
    Darren

    Has anyone run into an issue where the shortcut is created, but will not run/launch on Serve 2012 R2?

    1. David Vielmetter Avatar

      I have not seen this issue and I do have a couple of 2012 servers running. Can you tell me more about what is created? What do you mean a shortcut is created?

  3. Liam Phillips Avatar
    Liam Phillips

    Hi David,

    Loving the work you’ve done on this, it is helping me out very much on a project we are looking into, which is to start deploying BGInfo across to our desktop clients (rather than on servers). Please bear in mind that I’m currently studying for my 70-410 Installing and Configuring Server 2012, to then proceed to the Administration exams and onwards, so my technical knowledge is limited (have worked with the systems previously so have some knowledge on the subjects). Because of your work on the group policy side of things, this is enabling me to do so, however I am absolutely clueless when it comes to VBS coding.

    From previously code work, I get the gist of what is being done, however I would ask if I need to do anything other than remove/add the various bits, which I want to show on the client side after GP has been applied, under Configuration Declarations, and then edit the values Rem Configuration Values?

    Any help is most appreciated, however I understand you’re probably a busy man and this could take up just a little bit too much time for you to assist with! If you can help at all, that would be amazing. I’m more than happy to get a simple push in the right direction, as any help is better than none.

    Many thanks for the assistance so far with the videos!
    Kind Regards,

    Liam Phillips

    1. David Vielmetter Avatar

      Hi Liam,

      The use of the network.vbs script by bginfo.exe has been deprecated for a while. The new version of bginfo is just a single executable and the network.vbs file is no longer needed to obtain system and network information to display on the background. If you want, you can edit the vbs file, but it’ll just control what fields in the older version of bginfo will have data. To actually display that info on the background, you’ll want to use the .bgi settings file you call when launching bginfo. So in conclusion the way the old bginfo worked is:

      1. BGinfo uses network.vbs to obtain the info it can retrieve about the system and environment, it then stores that info in memory.
      2. BGinfo uses the settings.bgi file to display any subset of the information it retrieved via network.vbs on the system desktop.

      With the new version of BGinfo, the bginfo.exe no longer relies on network.vbs and retrieves information itself.

      hope it helps,
      David

      Cheers,
      David

  4. Richard Bruce Avatar
    Richard Bruce

    Thanks for a great video and article. I was glad that I read that last comment as I’d been scratching my head wondering what the .vbs file was for!

    Richard

Skip to content