Using PopulateGroups.bat
I've tested PopulateGroups.bat on Win2K Pro running Service Pack 2 (SP2) and NT Workstation running SP6. To use PopulateGroups.bat in your environment, you first need to download the script from the Code Library on the Windows Scripting Solutions Web site and install the Win2K or NT resource kit. The resource kit must be in the same path as the script. (If you want the resource kit in another location, you can specify that path in the script.)
Next, you need to create an input file that lists the PCs you want to test initially. Put one PC name per line, and save the PC input file as pclist.txt.
At this point, you need to customize the script for your environment. Here are the customizations:
- Customize the %temp% variable location, if needed. PopulateGroups .bat uses a %temp% variable that's typically a user variable. If you plan to run the script under a system account, this variable might not exist and cause the script to fail. Thus, you need to customize the line
Rem Set temp=C:\temp
First, uncomment the line by removing the Rem command. Then, replace C:\temp with your temporary variable location. (The location must be on the computer on which you plan to run the script.)
- Customize the name of the group you want to add. In the line
Set Group=domain1\helpdesk
replace domain1\helpdesk with your group's domain and name.
- Customize the location of the PC input file. In the code
SetTargetlist=
\\dom1pdc\tools\pclist.txt
replace \\dom1pdc\tools\pclist.txt with the path to your PC input file.
- Customize the name of the log. In the code
Set Log=
\\dom1pdc\tools\addlog.csv
replace \\dom1pdc\tools\addlog.csv with the path to your log.
- Customize the path to the rerun log that records the PCs to be tested on the next run. In the code
Set Rerunlog=
\\dom1pdc\tools\runagain.txt
replace \\dom1pdc\tools\runagain.txt with the path to your rerun log.
- Customize the local Administrators accounts in the code that callouts A, B, C, and D in Listing 2 highlight. Following the syntax
Net Use \\%target%\ipc$
password
/user:%target%\username
customize password (e.g., hello1, the 1man) and username (e.g., root, root1). You can add or delete accounts as needed.
Finally, schedule the script to run several times per day during the times when you think most of the computers will be on. After a few days of running the script, you'll have added the group to almost all the computers.