Flylib.com

Books Software

 
 
 

Recipe2.13.Putting System Information on the Desktop


Recipe 2.13. Putting System Information on the Desktop

Problem

You want to put information on the desktop wallpaper so that when you log into a server you can automatically see its configuration.

Solution

Using a graphical user interface

  1. Open the Sysinternals BGInfo program on the target server.

  2. The default configuration information is displayed. You can modify it directly or select a new setting in the Fields box and click the Add button. You can also create your own custom settings by clicking the Custom button.

  3. Click the Background button to customize the background color or bitmap.

  4. Click the Position button to customize where the BGInfo is displayed on the desktop.

  5. Click the Desktops button to configure the desktops where you want this information displayed. You can put it only on your desktop, on all console users' desktops, or on Terminal Services user's desktop.

  6. Click the Preview button to see what the new background would look like.

  7. Click the Apply button to commit the changes.

Discussion

If you maintain more than three or four servers, it can be difficult to distinguish them when you are logged onto the console or logged on with Terminal Services. And if you support multiple vendor models that have different hardware, it can be even more difficult to remember what is installed on each computer. Fortunately, there is a simple, yet elegant solution. Why not just put system information on the desktop background so that as soon as you log in, you can see how much memory is installed, view the disk configuration, find out how many CPUs are installed, etc.? The guys at Sysinternals have come through for us yet again by providing the BGInfo utility that can do exactly this. It is a highly customizable tool that lets you put just about anything you could think of on the desktop background.

You can configure where the information should be positioned in the background, you can use any background color or wallpaper you want, and you can even choose to configure whether only Terminal Services users should see it or whether it should be available to anyone that logs on. Figure 2-1 shows the default configuration screen for BGInfo.

Figure 2-1. BGInfo default configuration

If you'd like to use this across a set of servers, consider running BGInfo as part of a Group Policy logon script. It is fully scriptable from the command line. Run bginfo /? for more details.



Recipe 2.14. Configuring System Startup Options

Problem

You want to configure the system startup options for a server.

Solution

Using a graphical user interface

  1. From the Control Panel, open the System applet.

  2. Select the Advanced tab.

  3. Under Startup and Recovery , click the Settings button.

  4. Under the System Startup heading, you can modify the default operating system and the amount of time the system waits before loading the default OS.

  5. To change additional startup options on Windows Server 2003, you can click the Edit button to modify the boot.ini file. See the Discussion section for how to do this on Windows 2000.

  6. Click OK until all of the windows are closed.

Using a command-line interface

Windows Server 2003 includes a new tool called bootcfg.exe (also available with Windows XP) that lets you examine and modify the system startup options (including boot.ini ) from the command line. To get a list of the current startup options, run bootcfg without any parameters:

> bootcfg

The following command changes the timeout setting for the default OS option to 15 seconds:

> bootcfg /timeout 15

The following command adds the /DEBUG and /SOS options to the OS option defined by ID 2 (which you can see by running bootcfg without any options):

> bootcfg /Raw "/DEBUG /SOS" /A /ID 2

For the complete list of bootcfg options, run bootcfg /? from the command line.

Using VBScript
' This code displays the system startup settings.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."  ' e.g., rallen-srv01
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem")
for Each objCompSys in colCompSys
    WScript.Echo "Startup Delay: " & objCompSys.SystemStartupDelay
    for each strOption in objCompSys.SystemStartupOptions
       WScript.Echo "Operating System: " & strOption
    next
next
   
' This code sets the startup delay to 10 seconds.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."  ' e.g., rallen-srv01
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem")
for Each objCompSys in colCompSys
    WScript.Echo "Startup Delay Before: " & objCompSys.SystemStartupDelay
    objCompSys.SystemStartupDelay = 10
    objCompSys.Put_
    WScript.Echo "Startup Delay After: " & objCompSys.SystemStartupDelay
next

Discussion

For a list of options that are supported in boot.ini , see MS KB 833721.

Using a graphical user interface

The Edit button is available only on Windows Server 2003. If you want to modify the boot.ini file on Windows 2000, you'll have to use the procedures described next in the command-line solution.

Using a command-line interface

Since Windows 2000 doesn't come with the bootcfg utility, you have to modify the boot.ini file directly. First, make the file editable:

> attrib %SystemDrive%\boot.ini -h -r -s

Then edit the file:

> edit %SystemDrive%\boot.ini

And finally, make the file read-only and hidden again:

> attrib %SystemDrive%\boot.ini +h +r +s

Using VBScript

None of the scripting interfaces support modifying the boot.ini file (aside from direct file manipulation).

See Also

MS KB 99743 (Purpose of the BOOT.INI File in Windows 2000 or Windows NT), MS KB 102873 (BOOT.INI and ARC Path Naming Conventions and Usage), MS KB 242443 (Boot Menu Is Not Displayed and Timeout Value Is Not Used), MS KB 291980 (A Discussion About the Bootcfg Command and Its Uses), and MS KB 316739 (How to Use the /USERVA Switch in the Boot.ini File to Tune /3GB Configurations)