Now, this may prevent people from logging on,
depending upon the FSMO role situation on this domain controller.
So even though we don't have to down the entire server to
boot into Directory Services Restore Mode,
I just don't want to underestimate the potential
impact of even restartable AD DS,
particularly when it comes to DNS and FSMO roles,
as well as any other functions that your domain controller is offering.
Okay?
Okay, so now that we've gotten this far,
let me clear the screen,
and let's do an ntdsutil to enter the ntdsutil environment.
It's an interactive tool.
We'll do activate instance ntds,
and then we'll shift to the file maintenance context,
and I'm going to do a compaction.
Actually, I just realized that I didn't create a folder for it,
so let me just try compact to ctmp.
Oh, good.
I wasn't sure if there was a tmp folder.
So what happened here?
Well, the Active Directory database, as you can see,
is actually a file called ntds.dit.
Its under C:\Windows\NTDS.
And when you do an offline compaction,
you're basically creating another copy of the directory.
So in a very large environment, you want to make sure,
you have to make sure, actually,
that your compact to destination has enough free space to
accommodate another copy of that directory,
which mine does because it's tiny.
Now it says down below that Compaction was successful.
We need to do a copy statement here and then delete because that compacted
copy of the file still exists under c:\tmp\ntds.dit.
So let me take care of that now, copy c:\tmp\ntds.dit,
and we're copying it to C:\Windows\NTDS.
Actually, instead of just the DIT file,
I like the help that Microsoft has given us here because there are some
other files besides just the DIT file that are dependencies.
So notice that I'm doing c:\tmp\ntds.* to pick up all of the extensions
and then the to destination is going to be Windows\NTDS.
It didn't like that.
Maybe it was the quotes.
Let me try that one more time, ntds.*, and then we'll do C:\Windows\NTDS".
Huh?
Oh.
Okay, I think I know what the problem is.
I'm still in NTDS, so let me exit, or quit,
there we go, and then exit, quit, a couple of quits,
here we go, copy,
or let me actually see if I can get to command history with my up‑arrow.
No, I can't, unfortunately.
So, I'm going to do this one more time with feeling,
copy :\tmp\ntds.*, I shouldn't need quotes because I don't have spaces here,
NTDS, great, and then we've got delete.
I'm going to skip the del statement,
but that's just cleaning up any residual old log files.
Now, at this point, it's critical to know that we're not finished.
The AD DS database has stopped, so we're going to need to finish with a Flourish by doing a net start