| How do I create trusts
from the command line in Windows 2000? |
The Microsoft Windows 2000 Resource Kit’s Trustdom tool lets
you define trust relationships between Windows 2000 domains
and one-way relationships with Windows NT 4.0 domains. You
can create two types of one-way trusts: an outbound trust
on the local or specified domain, and an inbound trust on
the specified target domain. Trustdom’s syntax
isC:\> trustdom [[domain[:dc],]target_domain[:dc]]
[Options]
The default switch is -out. To see a list of other switches,
use the /? switch.
| How do I manually defragment
Active Directory? |
Windows 2000 servers running Directory Services (DSs) perform
a directory online defragmentation every 12 hours by default
as part of the garbage-collection process. This defragmentation
only moves data around the database file (ntds.dit) and doesn’t
reduce the file’s size.
To create a new, smaller ntds.dit file and to enable offline
defragmentation, perform the following steps.
- Back up Active Directory (AD).
- Reboot the server, select the OS option, and press F8
for advanced options.
- Select the Directory Services Restore Mode option, and
press Enter. Press Enter again to start the OS.
- Win2K will start in safe mode, with no DS running.
- Use the local SAM’s administrator account and password
to log on.
- You’ll see a dialog box that says you’re in safe mode.
Click OK.
- From the Start menu, select Run and type
cmd.exe
- In the command window, you’ll see the following text.
(Enter the commands in bold.)
C:\> ntdsutil
ntdsutil: files
file maintenance:info
....
file maintenance:compact to c:\temp
- You’ll see the defragmentation process. If the process
was successful, enter
quit
quit
- to return to the command prompt.
- Then, replace the old ntds.dit file with the new, compressed
version. (Enter the commands in bold.)
C:\> copy c:\temp\ntds.dit %systemroot%\ntds\ntds.dit
- Restart the computer, and boot as normal.
Below is an example of the entire procedure.
D:\> ntdsutil
ntdsutil: files
file maintenance: info
Drive Information:
C:\ FAT (Fixed Drive) free(1.2 Gb) total(1.9 Gb)
D:\ NTFS (Fixed Drive) free(152.4 Mb) total(1.9 Gb)
DS Path Information:
Database : D:\WINNT\NTDS\ntds.dit - 8.1 Mb
Backup dir : D:\WINNT\NTDS\dsadata.bak
Working dir: D:\WINNT\NTDS
Log dir : D:\WINNT\NTDS - 30.0 Mb total
res2.log - 10.0 Mb
res1.log - 10.0 Mb
edb.log - 10.0 Mb
file maintenance: compact to c:\temp
Opening database [Current].
Using Temporary Path: C:\
Executing Command: D:\WINNT\system32\esentutl.exe /d "D:\WINNT\NTDS\ntds.dit"
/
/o /l"D:\WINNT\NTDS" /s"D:\WINNT\NTDS" /t"c:\temp\ntds.dit"
/!10240 /p
Initiating DEFRAGMENTATION mode...
Database: D:\WINNT\NTDS\ntds.dit
Log files: D:\WINNT\NTDS
System files: D:\WINNT\NTDS
Temp. Database: c:\temp\ntds.dit
Defragmentation Status (% complete )
0 10 20 30
40 50 60 70
80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................
Note:
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
defragmentation, the database will be rolled back to the state
it was in at the time of that backup.
Operation completed successfully in 17.896 seconds.
Spawned Process Exit code 0x0(0)
If compaction was successful you either need to
copy "c:\temp\ntds.dit" to "D:\WINNT\NTDS\ntds.dit"
or run:
D:\WINNT\system32\ntdsutil.exe files "set path DB \"c:\temp\""
quit quit
file maintenance: quit
ntdsutil: quit
D:\> copy c:\temp\ntds.dit %systemroot%\ntds\ntds.dit
Overwrite D:\WINNT\ntds\ntds.dit? (Yes/No/All): y
1 file(s) copied.