Monday, January 20, 2020

Powershell - AD DS Database Maintenance

Try It: AD DS Database Maintenance

In this Try It you will stop AD DS, defragment the database, check the integrity of the database, and start AD DS. You will use Server Manager and the NtdsUtil tool to perform these tasks.
Stop AD DS
  1. Log on to LON-DC1 as Adatum\Administrator with password Pa$$w0rd.
  2. Open a Windows PowerShell prompt.
  3. Stop the AD DS service.
  4. Stop-Service ntds
  5. Notice that other services are affected by this action including the DNS Server. Thus, you can't stop the service without using the –Force parameter.
  6. Run the Stop-Service ntds –Force command to stop the service.
  7. Note that you could also stop the service in Server Manager\Tools\Services.
Perform an offline defragmentation of the AD DS database
  1. Run NtdsUtil.exe.
  2. At the prompt, view the Help. Pay particular attention to Activate and Files.
  3. ?
  4. Create an active instance.
activate instance NTDS
  1. Manage AD DS database files.
files
  1. At the file maintenance prompt, see what is available by typing a question mark and pressing the Enterkey. Notice the compact to and integrity options.
  2. ?
  3. Compact the database to the c: drive.
compact to c:\
  1. Wait for the defragmentation process to complete.
  2. Notice the recommendation to backup of the database, now that it is compacted.
Check the integrity of the offline AD DS database
  1. Ensure an integrity check of the database completes successfully.
Integrity
  1. Run quit two times to exit the utility.
  1. At the PowerShell prompt, start the AD DS service
  2. Start-Service ntds

  1. Note that you could also start the service in Server Manager\Tools\Services.
The launchpad to a career in IT. This program is designed to take beginner learners to job readiness in about eight months.

No comments:

Post a Comment