Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

February 01, 1998 12:00 AM

Reader to Reader - February 1998

Windows IT Pro
InstantDoc ID #2959
Rating: (0)
Downloads
drivespace.zip

[Editor's note: Share your NT discoveries, comments, experiences with products, problems, and solutions and reach out to other Windows NT Magazine readers (including Microsoft). Email your contributions (under 400 words) to Karen Forster at karen@winntmag.com. Please include your phone number. We will edit submissions for style, grammar, and length. If we print your letter, you'll get $100.]

In the October 1997 Reader to Reader, "Windows NT Message of the Day," William A. Dodd discussed how to create a pseudo Message of the Day feature for Windows NT Workstation or Server similar to that feature in UNIX. I have another way to create this option. My method uses existing system features and doesn't require creating and compiling a separate C program. However, you can create only one message per day.

My method uses two Registry entries—LegalNoticeCaption and LegalNoticeText—to create the pseudo Message of the Day. You will find these keys in the Registry entry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.

To make the Registry easier to work with and less prone to error, you can create a batch file to modify the Registry. The batch file creates a temporary file that regedit.exe uses to make the modifications to the Registry. (Although Microsoft recommends using regedt32.exe rather than regedit.exe as the Registry editor for NT, regedit.exe is adequate here because you're simply updating the Registry with string data.) Listing 1 contains the batch file, and Listing 2 shows you the contents of the resulting temporary file.

You can use my method to update or create other Registry keys. As with any process that modifies the Registry, make sure you back up the Registry before making any modifications.

Application Simplifies Creating User Accounts
My school district has Windows NT 3.51 and 4.0 running on servers and workstations. Each student in grades 6 through 12 receives accounts to access these computers. At each semester break, I must create a minimum of 600 accounts—a time-consuming task I don't enjoy.

Initially, I used User Manager for Domains and File Manager to create the user accounts. On average, I needed 2 days to input all the information. But now I use an application I wrote in C++ to quickly create user accounts. As the dialog box in Screen 1 shows, I define most of the user's initial account attributes and specify which groups the user will belong to. After I finish with the user account, the system automatically clears the first and last name text boxes, letting me quickly move to the next account.

Although I initially wrote the application to create user accounts, you can adapt it to perform many other functions. For example, I used the application to create several customized dialog boxes that I'll briefly describe.

Reset Password dialog box. Students occasionally forget their password. In the past, I had to go into User Manager for Domains to reset a password. But with the Reset Password dialog box, I just enter the server name, click Search, select the account, enter the password, and click Reset.

Locked Accounts dialog box. Students sometimes enter the wrong password and get locked out of their account. To quickly unlock accounts, I use the Locked Accounts dialog box in which I enter the server name, click Search, select the locked account, and click Unlock.

Scan Internet Log dialog box. The school district's network uses Microsoft Proxy Server to connect to the Internet. Proxy Server produces a log file showing all the activity for a given day. Searching through log files for a specific user's activities gets old fast, so I created the Scan Internet Log dialog box. I enter the log file name and click Scan, which brings up a list of the students who connected to the Internet that day, when they began and ended their Internet session, and how many hits they made. If I want to see the details for a specific student, I select that user and click Detail. A User Detail dialog box pops up, showing what sites the student visited and how often. If I want the details for a specific site, I select the site and click Detail, which brings up a dialog box showing the times the student visited the site.

Query dialog box. I created the Query dialog box to look at how many bytes and Megabytes of disk space each directory is using.

You can adapt this application for any number of uses. You can download the application's .exe file and three .dll files from the Windows NT Magazine Web site at http://www.winntmag.com.

Have Num Lock Come on Automatically
Have you ever been annoyed by Windows NT's habit of turning off the Num Lock key, even if your system BIOS turns it on at boot up? You might expect to find a check box to control the Num Lock key in the Control Panel under Keyboard, but none exists. You can, however, control the Num Lock key in the Registry under HKEY_CURRENT_USER\Control Panel\Keyboard. Change the value of InitialKeyboardIndicators to 2. Num Lock will come on automatically the next time you log on.

If you want to implement this fix systemwide, add the system policy template file in Listing 3 to your INF directory. You also need to load the system policy template file with your usual templates in System Policy Editor (SPE). Loading this file will add a check box for Numeric Keypad under the category Windows NT Login in SPE. Select the check box. Now, any users assigned to the policy will find that Num Lock comes on automatically.

Create User IDs Quickly and Efficiently
My company had just installed a new Windows NT network, so I needed to enter about 500 new user IDs, complete with description, logon script, and home directory path. In addition, I needed to create the home directories, set the proper permissions, and share the directories (again with the proper permissions). I wasn't looking forward to manually entering all this information.

But the task wasn't bad for two reasons. First, the characters for the user IDs and home directories were straightforward. The user ID was the first five letters of the user's last name followed by the user's first initial. For example, John Smith had a user ID of SmithJ. The user's home directory was the same name as the six-character user ID.

Second, I used several utilities in the Microsoft Windows NT Server Resource Kit and Microsoft Excel. The first resource kit utility that saved me hours of work was addusers.exe, which has the following syntax:

addusers [ \\computername ] [{ /c | /d | /e } filename] [/s:x] [/?]

The /c option adds users to NT based on information in a comma-delimited text file. The /d option dumps current user information to a text file. The /e option erases user information specified by a text file.

You can use addusers.exe not only to create users, but also to add them to local and global groups. For this discussion, I will address only creating users. To create users, complete the following five steps.

Related Content:

ARTICLE TOOLS

Comments
  • Greg
    10 years ago
    Mar 05, 2002

    Hi,
    I'm wondering if any has messed much with addusers.exe and CSV files.
    Here's my theory.
    C:\\>addusers /d C:\\AddusersMT.csv \\\\DomainController
    This dumps all users to a CSV file minus passwords. (CSV FIles are excellent for creating scripts. IE, column 1 == command, column 2 == switch. Open CSV file in a text editor, find and replace commas with a space to create the script.)
    Anyway, create the addusers dump to a csv file.
    Get a copy of your sam file off your NT server. (SYSKEY is enabled by default on 2000 Server but not on NT Servers, post SP4. If you find SYSKEY is enabled on your NT Server, you cannot undo this. The SAM file are encrypted to a 128Bit algorithm and can't be cracked in a reasonable time with a cracker like l0pht Crack.
    If SYSKEY is enabled, create a BDC for the domain and crack that SAM file. (IT's not SYSKEYed)
    In the ADdusers dump, sort by name. DO the same with the l0pht Crack dump. Copy the password column to the password column in the Adduser script you're creating.
    Run Addusers /c on the domain target domain controller. /C creates the accounts with the password field populated with the NT domain passwords.

    This is my theory, I hope it works because I won't want a plant full of common passwords.

    Also, consider Active Directory Migration Tool (ADMT) Google that, you'll find some good references. DOwnload it from Microsoft for free.

    It's good for migrating trusts, groups, accounts but there are limitations to password migration.
    It only lets you reset all passwords to the user name or create some bastardized password like @)(!h4D)4D.!~~

    Anyway, I'd be interested to hear if anyone has done this.
    Write to me:
    Greg
    zzsql@REMOVETHIS-hotmail.com.

    www.NetworkIQ.net

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.