Downloads
9031.zip

\[Editor's Note: Share your Windows 2000 and Windows NT discoveries, comments, problems, solutions, and experiences with products and reach out to other Windows 2000 Magazine readers (including Microsoft). Email your contributions (400 words or less) to r2r@win2000mag.com. Please include your phone number. We edit submissions for style, grammar, and length. If we print your submission, you'll get $100.\]

Microsoft IIS Tip
I recently moved a company Web site inhouse from a hosting firm. During the relocation, I restructured the Web site and removed many pages. As a result, many search engines sent surfers to dead links. To redirect users to the home page, I initially decided to use the Active Server Pages (ASP) Response.Redirect function to assign the new pages the names of the nonexistent pages. This task proved to be a chore, and I was worried that I might miss a page. I discovered that the best way to direct all inquiries that referenced our domain was to change the IIS 404 error message to redirect the user to our home page. A user can input http://www.ourdomain.com/
deadweasels.htm, and still reach our homepage.


Netscape Communicator Tips
When you encounter a JavaScript error or want to watch a command-line JavaScript processing, you can use Netscape Communicator's built-in JavaScript console. You can access this console by typing

javascript:

into the location bar. This JavaScript console is a mini HTML page. The bottom pane has the caption javascript typein. When you access this console from the location bar, you can change the caption for cosmetic reasons. For example, you can modify the caption to JAVASCRIPT typein or JaVaScRiPt typein by typing

JAVASCRIPT

or

JaVaScRiPt

You can also browse the Web from this console. To navigate to http://www .win2000mag.com/, type the following command into the JavaScript typein pane:

var d; d = window.open("http://
www.win2000mag.com/","_top")

 

Communicator breaks the frames in the console and loads the Windows 2000 Magazine home page into the console. The console window is resizeable, so you can maximize it when you use it as a browsing tool.

Setting Up NT Printers
My company recently rolled out approximately 500 new PCs on which we implemented Windows NT policies and profiles. We had some difficulty deciding how best to set up printers on the PCs because we had several groups that needed access to various printers because of geographical location or other reasons. One solution was to add all the printers that someone might use to the user's profile. However, this solution would be not only confusing to the users but also aggravating because the mandatory profile would force users to manually select the closest printer every time they wanted to print. A much simpler solution would be to point the PC to the closest printer.

I knew that if you logged on to an NT PC locally and added a local printer, that printer would be available to anyone who logged on to the PC. While logged on to a PC locally, I tried to map to a network printer, but the system presented an Access denied error message. The NT documentation didn't offer a solution for this problem.

Then, I discovered a workaround. If you log on to your domain, then add the printer, NT will let you install the printer while logged on locally as an administrator. From the printer setup wizard, select the Network Printer Server option, then input the printer's Uniform Naming Convention (UNC) name. After a few seconds, NT has installed the printer, and anyone who logs on to that PC can access it.


Changing a Mandatory Profile
We recently set up a national call center in which 70 NCD ThinSTAR terminals connect to three load-balanced Windows NT Server 4.0, Terminal Server Edition (WTS) servers. We used mandatory profiles to give us tighter control over the desktop and make changes to the desktop easier to maintain. The terminals use Microsoft Internet Explorer (IE) 5.0 to connect to an intranet site. After deploying the original client profile, we decided that we needed another home page URL. Instead of building another client profile, we used regedt32 to modify the ntuser.man file. This file contains numerous settings that you can control through the Registry.

To change the URL home directory for IE, use regedt32 and open the HKEY_USERS Registry key. (Open this key from the system on which you store mandatory profiles.) From the Registry menu, select Load Hive, then browse to the ntuser.man file, which is where the system stores mandatory profiles, and click Open. In the Key Name field, type

NTUSER

From the resulting window, you can access all the keys stored in this file. The key for the home page in IE 5.0 resides in the HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Main\Start Page Registry key. You simply enter the new page's URL in this string value field. After you make the necessary changes, highlight the NTUSER key, select Unload Hive from the Registry menu, and click Yes.


ERD Updates
As the number of computers you have to support increases, keeping Emergency Repair Disks (ERDs) updated can be a daunting task. To automate this time-consuming chore, I created a batch file, which Listing 1 shows, that I used with AT Scheduler to automatically update ERDs weekly.

First, you use the following AT command to tell each computer to run Rdisk once a week. (Rdisk will update the Repair folder on each computer's local hard disk.) From a command prompt, type

at \\NTW1 05:00 /interactive /every:W c:\winnt\system32\rdisk.exe /s-

(Modify this command for each system.) You can set the options to your preference. The previous example runs Rdisk in silent mode every Wednesday at 5:00 a.m. on the computer named NTW1.

Next, add the following AT command to each NT system's batch file and schedule the batch file to run once a week sometime after you've scheduled the Rdisk command to run:

at \\PDC1 07:00 /interactive /every:W c:\erd.bat

This process will take some time to set up initially, but you can use the copy and paste functions to save time. When a situation arises for which you need a particular system's ERD, copy the computer's files to a 3.5" disk.


Computer Name Batch Files
I spend much of my day talking to users over the phone about problems they're having. I can fix many of these problems without having to leave my desk. However, to do so, I need the name of the computer in question. Many users don't know the name of their machines, and walking them through the process of finding their computer's name can be painful. So I wrote a batch file, which Listing 2 shows, that helps me discover users' computer names. For finduser.bat to work, you must be running WINS, have permissions on the WINS server to view the WINS database, and have the Microsoft Windows NT Server 4.0 Resource Kit Winsdmp utility installed.

First, replace 10.1.1.1 in Listing 2 with the IP address of a WINS server on your network. Run finduser.bat at a command prompt, then you can use it to find a user's computer name. The batch file will search the WINS database for whatever you enter in the command line. For example, if I type

finduser boo

the batch file will search WINS until it finds something that matches boo, grab the IP address registered to that entry, then use ping -a to resolve the IP address to a name.

However, this process has a few gotchas. First, you need a good understanding of NetBIOS naming because it has some quirks. For example, if a user is logged on more than once, you'll only get the first machine that registered in WINS. This machine isn't always the computer that you're looking for.


Moving Shares
I've discovered a procedure for moving Windows NT shares from one drive to another drive in the same computer. Before you use this method, back up your Registry keys—particularly HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares.

I was running out of disk space on one of my NT Server systems. The system had four partitions based on a RAID 0 configuration. I needed to move three shares from the G partition to the E partition, but I needed the partitions to keep the NTFS and share-level permissions after I moved them.

First, I copied the Microsoft Windows NT Server 4.0 Resource Kit Supplement 4 scopy.exe utility to the server's \%systemroot%\system32 folder. Second, I created the same folder name on the E partition for each share on the G drive. For example, the G drive had three folders called Travel, Forms, and Reports. Thus, I created three directories on the E partition called Travel, Forms, and Reports.

Next, I used the scopy.exe utility to copy the G partition to the E partition. However, before you begin the copy procedure, make sure that no one is connected to the shares you need to copy. Therefore, performing this task during off-hours is a good idea. Use the following command for each share folder that you need to copy to the new partition:

scopy.exe G:\Travel E:\Travel /o /a /s

In this command, /o copies the owner information, /a copies file attributes, and /s copies any subdirectories.

After you've copied all share directories and their contents, launch Server Manager for Domains. Click the Computer menu's Shared Directories option. Highlight the share directories that you're in the process of moving, then click Properties. Change the path field from the current share path to the new path (e.g., change the path from G:\Travel to E:\Travel) and click OK. The system will present you with a warning message that tells you that the share is already in use and asks whether you want to stop the current share and create a new share. Click Yes.

Answers to This Month's Reader Challenge
You can find this month's Reader Challenge on page 25. The correct answers to the questions are as follows:

  1. B
  2. C
  3. A