Site hosted by Angelfire.com: Build your free website today!

NT Solutions

Home ] Security ] [ NT Solutions ] IPSec ] Disaster Recovery ] Fun ]

Change the spool directory
Fixprnsv can resolve printer driver incompatibitlity
Top 10 HP printing problems and how to fix them
Don't discount the value of NT Backup
Develop an effective data backup strategy
Learn the basics of command shell variables
Beef up your admin scripts with these extra tools

 

Beef up your admin scripts with these extra tools

July 15, 2003
Allen V. Rouse MCSE, MCDBA, CCNA

In a previous article, I mentioned IFMEMBER.EXE, a valuable Windows Resource Kit tool you can use to refine login scripts. Microsoft also provides a number of other tools that will help you improve your administration scripts. I'm going to show you where to find these tools and introduce a few that you may find useful. I'll also tell you about a particularly handy tool called KiXtart, which you can use to enhance your scripts.

Allen Rouse's previous scripting articles


Running executables in scripts
The utilities that Microsoft provides are command line executable files that come with their own syntax. To use them, you must first know how to run an executable file within a script.

Executing a utility within Windows shell scripts is fairly straightforward. You know that you can execute a command line program at the command prompt. Since shell scripts are basically a series of command line instructions, you can simply include the executable on its own line in the script. If it's not in the default path, just include the path as part of the command line.

For instance, one of the utilities that Microsoft provides is INUSE.EXE, a tool that can replace files that are currently in use by the operating system. To run it, you must specify the name of the source file and the name of the file to be replaced. For example, you might include a line like this in your script:
 
"C:\Program Files\Resource Kit\inuse.exe" f:\test1.dll \\SERVERA\Winnt\System32\test1.dll

It's not quite that easy in Visual Basic Scripting, but it's not too difficult either. First, to run a command line utility with a VBS script, you must access the Runmethod within the WshShell Object. The syntax for that is:
 
Wscript.Run (command, [WindowStyle], [WaitonReturn])

In this case, command is the complete command line utility with parameters, WindowStyle is an optional parameter that controls the style of the command window, and WaitonReturn is either true or false, specifying whether the script should wait until the utility completes processing before continuing with the script. Running INUSE.EXE within a VBS script might look something like this:
 
Set ObjWS = WScript.CreateObject("WScript.Shell")
ObjWS.Run ("INUSE.EXE f:\test1.dll \\SERVERA\Winnt\System32\test1.dll", 0,"true")

Head for the tool shed
So, now that you know how to use these utilities within a script, you need to know where to go to get them. The best place to go is the Windows Resource Kit. Both the Windows NT Resource Kit and the Windows 2000 Resource Kit have the tools. You can also download many of the individual tools here.

The Resource Kits generally provide you with not only the executable file, but also with complete information on how to use the tools, along with examples.

Figure A, for instance, shows the syntax for ADDUSERS.EXE, a command line utility you can use to create users and groups within a script.



The Resource Kits conveniently group the tools by functionality, as shown in Figure B. You can use the Search tab if you need to find a specific tool.

Figure B


Table A lists a few of the many Resource Kit tools you might find useful in your scripts for network administration.

Table A
Delprof.exe Deletes user profiles from a Windows 2000 computer
Delsrv.exe Unregisters a service
Regini.exe Edits the registry with a script
Logoff.exe Automatically logs off when used in an unattended installation
Permcopy.exe       Copies share and file permissions from one share to another
Now.exe Stamps current date and time

Also consider KiXtart
The Windows Resource Kits also include a great scripting tool called KiXtart. This tool is a logon script processor and an enhanced batch scripting language developed for Windows by Ruud van Velsen of Microsoft Netherlands. It's free software, but the author calls it CareWare and asks that users donate to a charity in lieu of paying a fee for using it.

You will find documentation for the tool, as well as the actual files for download, at kixtart.org. The manual available for download from this site carries 120 pages of extensive documentation.

The only file required for Windows NT and higher is kix32.exe. With it, you can launch any KiXtart script, which is a text file written in the KiXtart scripting language. The language is neither shell scripting nor VBS, but a separate scripting language with a great deal of functionality. It can process commands based on group membership, and it can be used for mapping drives, editing the registry, manipulating the file system, and a lot more.

Each script file, created with a text editor such as Notepad, is saved with the extension .kix. Let's say you create a file and name it myscript.kix. This script can then be run with a simple command like this:
Kix32.exe myscript.kix

You can execute it at the command prompt or place the command into a Windows shell script.

End sum
Now that you know about all of these great tool resources available to you, you can start using them in your scripts. You will want to take the time to learn them, of course, as well as practice them extensively on a lab network before you use them on a production network. Fortunately, both the Resource Kits and KiXtart have good documentation on syntax and usage.

 

Copyright ©1995- 2003 CNET Networks, Inc. All Rights Reserved.
Visit us at www.TechRepublic.com

 

Learn the basics of command shell variables

Variables are indexes for memory counters that hold a specific value. To display the Windows NT command shell's preset environment variables, type the command SET. To declare a new variable and set its value, type the following:

SET variable=value

Replace variable with the variable's name, and replace value with the variable's value.

Command shell variables in NT can contain either alphabetic or numeric values. The NT command shell treats all variables you set with the SET command as text unless you use SET with the /a parameter to type the variable as numeric.

Once you've set the variable, you can substitute its value in a command by enclosing the variable's name in percent signs.

SET /a count=1
SET /a count=%count% + 1
Echo %count%

The last ECHO command statement will output the number 2 on the screen. The most important thing to remember about variable substitution is that the NT command shell substitutes variables before it interprets any part of the command. Therefore, you can use variables to construct any part of a command statement, including a command itself.

Redirect the command shell's standard output

NT command shell commands and most command console applications, such as those found in the Windows NT Server Resource Kit, output ANSI character data that the command shell displays as text on your screen. This text output is also known as standard output, and you can capture it to files, pipe it as standard input to other commands, or assign its value to a variable.

To capture output to a file, use the redirection symbols [>] or [>>]. The single greater than symbol captures the output to the specified file while overwriting the existing file's contents. The double greater than symbol captures the output and appends the data to the target file's contents. For example:

DIR > dir.txt

This captures the DIR command's output to the text file Dir.txt and overwrites any preexisting data that the file contained

 

Develop an effective data backup strategy

November 30, 2001
Mike Talon

The tragic events of September 11 have made us all more aware of the devastating potential of a physical disaster. Many companies are looking carefully at their backup strategies to ensure data integrity, reliability, and business continuity in the event of a disaster.

Developing a good backup strategy requires thoughtful planning, from the selection of devices to the determination of backup schema and other logistical issues. Each step must be carefully analyzed in light of such factors as staffing, technical expertise, and budget. We’ll take a look at these factors and break down the requirements of a successful backup strategy.

Selecting your backup system
First, an organization must determine what backup platform (hardware) it will use for data protection. Many choices exist, from extensive data-replication systems that create off-site replicas to traditional tape-based systems. Budget and expertise will determine which method (or combination of methods) is best for your organization.

Tape systems are generally the least expensive and least technologically complex of the choices on the market today. Since tape systems will meet most of the audit and reporting requirements facing the modern enterprise, we’ll focus primarily on this methodology.

Before you can determine your backup strategy, you must first determine how much data your organization will be protecting. This information will help determine what type of system you require—from single-tape drives through jukebox or silo systems that can manage hundreds of tapes at a time.

The process of determining what will be protected goes beyond summing up the total of all data on your servers, since much of this data is likely not mission-critical to your organization. Prime examples are program and application files—which are easily restored from the original media—and users’ personal files, such as MP3s.

Once you know the amount of data you need to protect, you can determine which type of device best suits your needs. DDS tape systems are generally acceptable only for smaller organizations with less than about 10 GB of data to protect. For the small/home office, this is a very good choice, since the drives are economical and are considered reliable. Many jukebox or silo options are also available for this platform, allowing these venerable tapes to scale to meet most small to midsize business needs as well.

For the larger business, DLT tape systems are somewhat more expensive but have significantly greater capacity for data. DLT systems can be scaled to meet the data-protection needs of most organizations, regardless of size. Jukebox and silo systems are also available for this platform, including robotic and other forms of automated rotation systems to handle the needs of even the largest organizations.

Once you’ve decided on hardware, it’s time to set your sights on software. There are many excellent backup software systems on the market today. Each offers similar functionality, so take a look at interfaces, pricing, and other factors to determine which is right for your organization. Two of the leading products are ARCserve and BackupExec.

Setting up your methodology
Your next step is to determine the best methodology for backing up your data. Most commercial backup software systems allow for a wide array of options. The most common are the following:

Essentially, the method you choose will depend on your tape capacity and your need for a very speedy recovery. For example, by running a full backup daily, you will need a very large amount of tape capacity but will need only the last backup tape to restore all data.

Conversely, using a full backup once a week with an incremental daily lets you use much less tape space, but a recovery would require the last full backup and each incremental to be fed back onto the servers. Most organizations will utilize a combination of methodologies that allows them to conserve tape space while still allowing data to be quickly restored. Using weekly full backups with daily incremental backups is generally considered the strategic norm.

Rotating your tapes
Next you will need to develop a tape rotation scheme and decide where to store your tape media. Unfortunately, most companies store physical backup media within about three feet of the servers they protect. As recent physical disasters have shown us, this is not a prime way to protect data since the tapes stand a very good chance of being lost with the servers in a disaster. Physical media needs to be stored off-site in a secure location from which it can be retrieved quickly if needed.

To reduce costs for both media and off-site storage, a good tape-rotation scheme is essential. By reusing tapes after a predetermined period of time, tape rotation schemes ensure that a minimum number of tapes are stored off-site. Rotation schemes come in several flavors and complexities.

Perhaps the most common rotation scheme is Grandfather-Father-Son (GFS), which has been in use for quite some time and has proven to be effective. In the generic version of this scheme, full backups are done at two intervals. The first interval is monthly, and that media is immediately stored off-site (grandfather). Weekly full backups are also performed (father), and these are generally held on-site for the week of their use, then moved off-site for a predetermined number of weekly cycles (two or three cycles is generally sufficient).

Daily incremental backups are performed (son) and stored on-site for the week of their use as well, then moved off-site with the corresponding weekly backup on the same cycle schedule. At the end of a cycle for a set of tapes, those tapes can be returned to the system and reused. Each monthly tape would be held for 12 months before being reused.

Weekly tape sets are generally held for about three weeks after they leave the server room (so about four weeks total) and are then reused. The number of times a tape can be reused is determined by the type of media, so check with the manufacturer to ensure you don’t overuse a tape.

GFS rotation schemes allow for the monthly backups to be immediately stored in a secure location, while the most current weekly full backups and incrementals are housed for immediate use in restoration, then allowed to sit off-site in case of a catastrophic failure. While there is some limited liability inherent in this system (you could lose up to one week of data if you suffer a fire or some other disaster), this system offers the highest security with the lowest cost.

Of course, your organization may require more security, in which case you can always courier tapes off-site as they are generated. While this is a great system for data protection, keep in mind you will need to get those tapes back on-site for restoration purposes, which will increase courier and other costs.

Final word
By determining what data needs to be protected, what media to use for that protection, and how you will protect the media itself, you can create and maintain a reliable backup system for your organization. Such a backup system will ensure business continuity in the event of a disaster.

How do you plan to modify your current backup system?
We look forward to getting your input and hearing your experiences regarding this topic. Post a comment or a question about this article.

 

Copyright ©1995- 2003 CNET Networks, Inc. All Rights Reserved.
Visit us at www.TechRepublic.com

 

Don't discount the value of NT Backup

Notice to subscribers: Due to the Labor Day holiday, the Windows NT e-newsletter will not be delivered on Monday, Sept. 1, 2003. Look for your next edition of Windows NT on Thursday, Sept. 4, 2003.

Often written off as a useless utility in the shadow of heavyweight tools such as ARCserve and Backup Exec, the Windows NT Backup utility is actually both beneficial and cost-effective.

For example, you can use NT Backup to back up an Exchange information store even while it's running and serving requests. In addition, installing Exchange management utilities on a server automatically extends the Windows NT Backup utility to enable it to handle Exchange databases.

This goes for more than just Windows NT. Windows 2000 and Windows Server 2003, as well as both Exchange 2000 and Exchange 2003, extend the versions of NT Backup installed on those systems to handle the same function.

When using a utility such as ARCserve or Backup Exec to back up Exchange databases, you need to either use an agent or back up the databases while they're offline. If your organization is short on cash but needs to back up Exchange data while it's online, use NT Backup to handle this task. If you use ARCserve or Backup Exec, you can then back up the file created by NT Backup during your regular backup process.

 

Top 10 HP printing problems and how to fix them

September 9, 2003
Scott Lowe MCSE

While they're generally very reliable, even in the most demanding of environments, HP printers are still problematic from time to time. And we all know printers fail at the most inopportune moments. For an IT support professional, it's critical to know how to fix the most common problems associated with these printers. I've identified 10 problems you can expect to run into most often when dealing with an HP printer, and I've included suggestions on fixing them.

1. Paper jams
Among the most common problems with any make of printer are paper jams. A printer will jam for any number of reasons: It’s dirty, the wrong paper type is being used, or the rollers on the printer that feed the paper through its pathway are worn down. While cleaning the printer periodically and using the correct paper type are easy fixes, roller replacement can be a difficult job depending on the model of HP printer. For some HP printers, the rollers are easily accessible, but you'll need to completely tear down other models to remove the rollers. Regardless of the cause, when removing a paper jam, always pull the paper in the direction of the paper path, because pulling it backwards can severely damage the printer.

Certain HP printers are more susceptible to paper jams than others. In my experience, any printer that holds the paper vertically and then pulls it down through the printer invariably ends up having paper jam problems. These models aren't designed for heavy use, but many organizations make use of them on individual systems and should be aware of this flaw. In addition, some people have trouble with the newer HP 4000 series printers' paper pickup rollers—which is odd, because the older 4000 and 5000 series HP printers are considered rock solid and don't seem to have any trouble with their pickup rollers.

2. Some or all of the printing on the page is faded
A faded print image is normally the result of one of three conditions: The printer is getting low on toner, the print density is set too low, or Economode printing is turned on. For the last two settings, a printer self-test (typically a separate button on the printer) will show what the current settings are. If Economode is on, and users are complaining about how light the print is, turn it off and/or set the print density higher. If the toner is low, simply removing the cartridge and shaking it to redistribute the toner more evenly can temporarily resolve the problem until you can replace the cartridge.

3. Ghosting
Ghosting is a condition where the image prints properly, but a much lighter copy of the image also prints elsewhere. This can be due to a problem with the power outlet that is supplying power to the printer. Check the power outlet by plugging in a different printer to see if the same results occur. Ghosting can also be caused when consumable printer parts (such as the drum or imaging kit) are near the end of their life. All of the consumable parts in a printer are rated for a certain number of pages. Once a printer gets near that magic number, you'll need to replace those parts to eliminate ghosting.

4. Toner smears or does not stay on the paper
If words and images come off the paper when a hand is run across them, there are a few possible problems. First, the fuser assembly may be damaged or at the end of its life. The solution is to replace the fuser assembly. Repairing a fuser assembly is generally not recommended because the fuser is considered a consumable printer part and not worth the time or effort to fix. Second, the toner cartridge may be defective and letting too much toner out at one time. In a black-and-white laser printer, the solution is to replace the toner cartridge. In a color laser printer, only replace the cartridge that is exhibiting the problem. Third, some toner may have spilled in the printer. If so, you'll need to clean it out.

5. Printer is displaying a 50.4 error message
A 50.4 error message on some of the newer HP LaserJet printers indicates a problem with the power supply. If the printer is connected to a UPS, disconnect it, or disconnect it from a power strip and plug it directly into a wall outlet. A laser printer should never be plugged into a UPS, because the UPS can be damaged by the surges of power required by a printer to keep the fuser assembly warm. If that doesn’t work, make sure that all of the components in the printer are seated properly.

6. Can't find a driver for a particular operating system
As new operating systems are released, new drivers will need to be loaded for your existing printers. Not all printers have a driver for every OS. In these cases, it’s best to consult the printer manual and find out what printers the drivers will emulate. While not all of the functionality of the printer will be available under this emulation, at least basic printing will work. For example, most HP printers will print with the HP LaserJet II driver installed, although specific options, such as duplexing, will not work.

7. Printer is not printing from the expected paper tray
Look in two places to correct this particular error. First, look on the printing PC, and second, on the printer. If the application is set to print to the wrong paper tray, correct it within the application by clicking on Printer Properties and finding the Tray Selection source. On the printer, make sure that the paper sizes in the control panel match what is actually in the paper trays.

8. Printer picks up all the paper from the manual feed tray rather than one sheet
The pad that is responsible for separating the paper has likely worn out and needs to be replaced. You can order and install a new pad without sending the printer out for repair. It is also possible that the paper is wet due to humidity. Make sure the paper is properly stored and that it is “fanned” before putting it into the printer.

9. Printer is displaying a 79 error
A 79 error can be the result of a problem with the network print server that services the printer. When troubleshooting a 79 error, first open the Printer folder from the Start menu on the Print server to make sure there are no jobs pending. A 79 error can also indicate a failure of a printer add-on component, such as an MIO card or a RAM module. All add-ons should be removed and then added back to the printer one by one to determine which module may be at fault.

10. Trouble printing onto envelopes
Envelopes can cause many problems for laser printers. Choose envelopes that are close to 20-lb paper in weight and thickness. Also, make sure that the adhesive on the envelope is capable of withstanding the heat that the fuser puts out to keep the printing on the page. If you don’t, the envelopes will come out of the printer already sealed. If envelopes are coming out of the printer wrinkled, they may be too stiff for the paper path. Open the rear of the printer and let them exit at that location instead.

HP printers are considered to be among the most reliable in the industry. But just as any other piece of IT equipment, they're vulnerable to failure. And it seems the newer printers can’t withstand the same amount of abuse that the older models could. So if you work on newer-model HP printers in a paper-intensive environment, expect more troubleshooting calls involving the problems I've described. But no matter what the age of your HP printer, this guide to common printing problems will help you diagnose and fix the problem quickly.

Copyright ©1995- 2003 CNET Networks, Inc. All Rights Reserved.
Visit us at www.TechRepublic.com

 

Fixprnsv.exe can resolve printer driver incompatibility

November 5, 2002
Del Smith CCNA, CCA, MCSE

It is not uncommon to find a mix of Windows NT 4.0 Workstations and Windows 2000 Professional clients in an organization undergoing an upgrade or migration to Windows 2000 Server. Because network printing involves the rendering of print jobs using both client and server driver functions, printing in such an environment can present undesired challenges and results. Fortunately, Microsoft’s Fixprnsv.exe utility can reduce many of the compatibility issues experienced with printing in these types of mixed environments.

Fixprnsv.exe overview
Located on the Windows 2000 Server CD under the PRINTERS directory, Fixprnsv.exe is an essential tool for working with printer driver issues on Windows NT 4.0 and Windows 2000 print servers. You can run this utility directly from the CD or you can copy the FIXPRNSV folder to the hard disk of the appropriate system(s), and run it from there.

Printing problems can occur when the printer model names in the .inf files included in Windows NT 4.0 Service Pack 4 or later do not match with those in Windows 2000. Fixprnsv.exe automatically adds the appropriate Windows 2000 drivers from the Windows 2000 CD, allowing Windows 2000 clients to connect to and use the NT 4.0 print server. If run on a Windows 2000 print server, Fixprnsv.exe will replace all non-NT 4 compatible printer drivers with compatible ones, allowing NT 4 clients to connect and print. If no replacement driver is available on the Windows CD, the utility prompts you to obtain an updated driver from the printer manufacturer.

Printing differences
The printing subsystem of Windows 2000 has greatly improved over previous versions of Windows NT. In Windows NT 4.0, printer drivers, referred to as version 2 drivers, ran in the kernel mode of the operating system. With a kernel-mode driver, an error could crash the entire server. No doubt many veteran Windows administrators have experienced this.

With Windows 2000, Microsoft moved to user-mode drivers, called version 3 drivers. Realizing the coexistence of NT 4.0 and Windows 2000, the folks at Microsoft wisely maintained kernel-mode drivers in Windows 2000 for backward compatibility. The result is a more reliable and stable printing system since print driver errors are restricted to the process the driver runs in, which is typically the print spooler. Now a corrupt or incompatible printer driver simply results in a stoppage of the spooler, thus eliminating the need to reboot the entire server.

In a network environment where Windows NT 4.0 serves as the print server to both Windows NT 4.0 and Windows 2000 clients, all clients must use the Windows NT 4.0 driver. In environments where Windows 2000 is the print server to both Windows NT 4.0 and Windows 2000 clients, the appropriate NT 4.0 print driver must exist on the Windows 2000 print server for point-and-print functionality.

Running Fixprnsv.exe
Running Fixprnsv.exe prior to the upgrade from NT 4.0 to Windows 2000 will identify problematic printer drivers that need to be removed in advance. A list of printer drivers that have been verified to cause system problems are maintained in the Printupg.inf file of the Fixprnsv folder on the Windows 2000 Server CD. Drivers in this list are not upgraded during an NT 4.0 to Windows 2000 operating system upgrade. Printers identified on the “problem” list will require a compatible Windows 2000 version of the driver provided by the specific hardware vendor or you must use an alternate driver selected from the list of Microsoft drivers.

Running Fixprnsv.exe at the command line with the /diag switch on either an NT 4.0 or Windows 2000 server checks for incompatible drivers but does not replace any, as shown in Figure A. This switch is useful for determining whether the driver you require is on the Windows 2000 CD or will need to be tracked down from the manufacturer.




Remember that when running Fixprnsv.exe on an NT 4.0 machine, Windows 2000 drivers will be installed, allowing Windows 2000 clients to connect and use the print server. This is done by running the command with the /fix switch. Running the utility on a Windows 2000-based computer replaces any incompatible Windows NT 4.0 printer drivers. Figure B provides an example.



You can obtain additional command-line help for running Fixprnsv.exe by using the /? switch. A Fixprnsv.log file is recorded in the root of the system directory for review. It is important to note that there is no rollback option available for this utility. Any adverse results or actions will require manually replacing the driver for each print queue. Also, Fixprnsv.exe obviously won't install drivers for printers that are not already configured on the print server, so you may need to run it again periodically.

Summary
Fixprnsv.exe is a powerful tool that can resolve common printer driver incompatibility issues associated with NT 4.0 and Windows 2000 printer drivers. Organizations that need to maintain down-level printing during a Windows 2000 upgrade or migration can take advantage of this utility to prevent sudden printing disruptions.

 

Copyright ©1995- 2003 CNET Networks, Inc. All Rights Reserved.
Visit us at www.TechRepublic.com

 

Change the spool directory

Occasionally, you may notice that your print server may hang when logging onto or stopping and restarting the spooler service. This occurs because of an overly large number of documents in the spool folder.

If the buffers of your printers can hold them, you can send documents faster by implementing an LPR fix. If not, or if you aren't using TCP/IP Printing, then copy the files out of the spool folder to another location on the hard drive, and copy them back a few at a time.

To free up space on your system hard drive, you may want to change the default location of the spool folder on your system. Moving it from the Spool\Printers folder of your System32 location will do the trick.

You can change the spooling folder for all printers or for individual printers with a change to the registry.

For all printers:

[HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet\Control\Print\
Printers]

"DefaultSpoolDirectory"="<Full path to new spool>"

For individual printers:

[HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet\Control\Print\
Printers\<specific printer>]

"SpoolDirectory"="<Full path to new spool>"

Note: Editing the registry is risky, so be sure you have a verified backup before saving any changes.