How to Rebuild the Full-Text Index Catalog

  1. Start the Exchange Management Shell.
  2. Remove the index directories that are associated with specified mailbox databases
  3. ResetSearchIndex.ps1 [-force] <dbname> [<dbname>]
  4. Remove the index directories that are associated with all mailbox databases:
    ResetSearchIndex.ps1 [-force] -all
  1. Stop the Microsoft Exchange Search Service by running the following command:
    Net Stop MsExchangeSearch
  2. Delete the full-text index catalog directory.

    There are scripts located in the \Exchange Server\Scripts directory that can help you to administer and manage Exchange Search. Using the Exchange Management Shell, you can run the following scripts:

    • GetDatabaseForSearchIndex.ps1   When the index directory files are provided, this script returns the associated mailbox database names. Example script:
      GetDatabaseForSearchIndex IndexDirectoryName1 IndexDirectoryName2
    • GetSearchIndexForDatabase.ps1   This script returns index directories for the specified mailbox database names. Example script:
      GetSearchIndexForDatabase MailboxdatabaseName1 MailboxdatabaseName2 -All
      noteNote:
      The directory name follows the convention CatalogData-<guid>-<guid> where the first <guid> is the GUID of the database, and the second <guid> represents the Instance GUID, which is used on a clustered mailbox server to distinguish between the nodes. The following is an example folder name: \CatalogData-b56624f3-bf19-4463-926f-d4705ac3dd08-cc64dd2d-2428-4f12-bba2-79d6d34c4d27
      The typical path for the .edb files and the catalog data directory is: C:\program files\microsoft\exchange server\mailbox\first storage group\

    You can use the following example to verify that you are targeting the appropriate catalog directory:

    GetSearchIndexForDatabase -All
  3. Start the Microsoft Exchange Search Service by running the following command:
    Net Start MsExchangeSearch

Find Last Restart of SQL Server

Here are a few different ways that you can tell when SQL Server was last started.


Method 1: sys.dm_os_sys_info

This DMV, sys.dm_os_sys_info, contains a column that holds the startup time for SQL Server. You can run the following command to find the start time.

SELECT sqlserver_start_time FROM sys.dm_os_sys_info

sys.dm_os_sys_info


Method 2: SQL Server Error Log

If you open the current SQL Server error log in SSMS under Management > SQL Server Logs and scroll to the bottom of the error log you can see when the server was started. Note the highlighted text below “SQL Server is starting”.  You will want to look for this to make sure the error log was not cycled and give you a false impression of the start time.

sql server error log start up time

Here is an example of a cycled error log and note the highlighted text.   If you see this you will need to look at a previous error log until you find the log that contains the information in the image above.

sql server log initialized

Note: if you are running the Express edition of SQL Server you cannot read the error logs directly from SSMS, but you can use xp_readerrorlog or navigate to the folder where the log files are stored and use a text editor to read the SQL Server error log files.


Method 3: Dashboard Reports

Another option is to use the SQL Server Dashboard Report.  Right click on the server name in SSMS and select Reports > Server Reports > Server Dashboard and you will get a report similar to the following.

sql server dashboard report


Method 4: Windows Event Viewer

Another option is to use Windows Event Viewer to look for the startup time.  If you open Windows Event Viewer and filter your Event Sources (in our case MSSQL$SQL2008) for the SQL Server instance and Event ID 17162 you can find all of the startup times that are still in the Event Viewer log.

windows event viewer start time

Here is a partial listing of the startup times for this instance.

windows event viewer sql startup log

Set vSphere VMs To Power Up Automatically

The setting in vSphere is a property of the ESX(i) host, found within the configuration tab in the Virtual Machine Startup/Shutdown options section. Fig. 1 shows how to set automatic startup for VMs on a host.

A VM startup sequence can be set with timing for each host.
Figure 1. A VM startup sequence can be set with timing for each host. 

The properties section will allow the startup options to be configured. It is a good idea to shorten their startup time if the hosts power up and are ready to go

How to find a Global Catalog server?

With DNS Requests (NSLOOKUP)

In an Active Directory environment, all Global Catalogs are anchored in DNS . There is a separate subdomain ‘GC._msdcs ….’ in the namespace of the AD root domain (please remember: the global catalog does not refer to individual domains, but to the entire forest). So if your root domain in the forest is e.g. contoso.com, then you get a list of all GCs with this command:

C:\> nslookup gc._msdcs.contoso.com

Server:  dc.contoso.com
Address:  10.10.67.250

Name:  gc._msdcs.contoso.com
Adresses:  10.10.67.250
10.10.67.251
10.10.67.252
10.10.67.253

The container _msdcs contains the infrastructural DNS records of the Active Directory. This is also where all the SRVservice records for the domain controllers are stored.

With DSQUERY

You can also use the standard command line tool DSQUERY for searching GCs. The search can be limited to certain domains or AD sites. However, you must be authenticated in the regarding forest and DSQUERY must be available on your machine (this is usually the case on Widows servers). As a result, the server objects in the Configuration partition is displayed:

C:\> dsquery server -isgc

“CN=DC,CN=Servers,CN=Site-Sidney,CN=Sites,CN=Configuration,DC=contoso,DC=com”
“CN=DC014,CN=Servers,CN=Site-Auckland,CN=Sites,CN=Configuration,DC=contoso,DC=com”

Remove Offline Domain Controller / Active Directory Metadata Cleanup

Metadata cleanup is a required procedure after a forced removal of Active Directory Domain Services (AD DS). You perform metadata cleanup on a domain controller in the domain of the domain controller that you forcibly removed. Metadata cleanup removes data from AD DS that identifies a domain controller to the replication system. Metadata cleanup also removes File Replication Service (FRS) and Distributed File System (DFS) Replication connections and attempts to transfer or seize any operations master (also known as flexible single master operations or FSMO) roles that the retired domain controller holds.

You can clean up server metadata by using the following:

When you use Remote Server Administration Tools (RSAT) or the Active Directory Users and Computers console (Dsa.msc) that is included with Windows Server 2008 or Windows Server 2008 R2 to delete a domain controller computer account from the Domain Controllers organizational unit (OU), the cleanup of server metadata is performed automatically. Previously, you had to perform a separate metadata cleanup procedure.

You can also use the Active Directory Sites and Services console (Dssite.msc) to delete a domain controller’s computer account, which also completes metadata cleanup automatically. However, Active Directory Sites and Services removes the metadata automatically only when you first delete the NTDS Settings object below the computer account in Dssite.msc.

As long as you are using the Windows Server 2008, Windows Server 2008 R2, or RSAT versions of Dsa.msc or Dssite.msc, you can clean up metadata automatically for domain controllers running earlier versions of Windows operating systems.

Membership in Domain Admins, or equivalent, is the minimum required to complete these procedures. Review details about using the appropriate accounts and group memberships at Local and Domain Default Groups (http://go.microsoft.com/fwlink/?LinkId=83477).

  1. Open Active Directory Users and Computers: On the Start menu, point to Administrative Tools, and then click Active Directory Users and Computers.
  2. If you have identified replication partners in preparation for this procedure and if you are not connected to a replication partner of the removed domain controller whose metadata you are cleaning up, right-click Active Directory Users and Computers <DomainControllerName>, and then click Change Domain Controller. Click the name of the domain controller from which you want to remove the metadata, and then click OK.
  3. Expand the domain of the domain controller that was forcibly removed, and then click Domain Controllers.
  4. In the details pane, right-click the computer object of the domain controller whose metadata you want to clean up, and then click Delete.

    Metadata Cleanup in ADUC

  5. In the Active Directory Domain Services dialog box, click Yes to confirm the computer object deletion.
  6. In the Deleting Domain Controller dialog box, select This Domain Controller is permanently offline and can no longer be demoted using the Active Directory Domain Services Installation Wizard (DCPROMO), and then click Delete.

    DC offline in AD Users and Computers

  7. If the domain controller is a global catalog server, in the Delete Domain Controller dialog box, click Yes to continue with the deletion.
  8. If the domain controller currently holds one or more operations master roles, click OK to move the role or roles to the domain controller that is shown.

    You cannot change this domain controller. If you want to move the role to a different domain controller, you must move the role after you complete the server metadata cleanup procedure.

 

  1. Open Active Directory Sites and Services: On the Start menu, point to Administrative Tools, and then click Active Directory Sites and Services.
  2. If you have identified replication partners in preparation for this procedure and if you are not connected to a replication partner of the removed domain controller whose metadata you are cleaning up, right-click Active Directory Users and Computers <DomainControllerName>, and then click Change Domain Controller. Click the name of the domain controller from which you want to remove the metadata, and then click OK.
  3. Expand the site of the domain controller that was forcibly removed, expand Servers, expand the name of the domain controller, right-click the NTDS Settings object, and then click Delete.

    Metadata Cleanup in AD Sites and Services

  4. In the Active Directory Domain Services dialog box, click Yes to confirm the NTDS Settings deletion.
  5. In the Deleting Domain Controller dialog box, select This Domain Controller is permanently offline and can no longer be demoted using the Active Directory Domain Services Installation Wizard (DCPROMO), and then click Delete.

    DC offline in AD Users and Computers

  6. If the domain controller is a global catalog server, in the Delete Domain Controller dialog box, click Yes to continue with the deletion.
  7. If the domain controller currently holds one or more operations master roles, click OK to move the role or roles to the domain controller that is shown.
  8. Right-click the domain controller that was forcibly removed, and then click Delete.

    DC Deletion in AD Sites and Services

  9. In the Active Directory Domain Services dialog box, click Yes to confirm the domain controller deletion.

As an alternative, you can clean up metadata by using Ntdsutil.exe, a command-line tool that is installed automatically on all domain controllers and servers that have Active Directory Lightweight Directory Services (AD LDS) installed. Ntdsutil.exe is also available on computers that have RSAT installed.

  1. Open a command prompt as an administrator: On the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, provide Enterprise Admins credentials, if required, and then click Continue.
  2. At the command prompt, type the following command, and then press ENTER:

    ntdsutil

  3. At the ntdsutil: prompt, type the following command, and then press ENTER:

    metadata cleanup

  4. At the metadata cleanup: prompt, type the following command, and then press ENTER:

    remove selected server <ServerName>

    Or

    remove selected server <ServerName1> on <ServerName2>5.In Server Remove Configuration Dialog, review the information and warning, and then click Yes to remove the server object and metadata.

  5. At this point, Ntdsutil confirms that the domain controller was removed successfully. If you receive an error message that indicates that the object cannot be found, the domain controller might have been removed earlier.

    6.At the metadata cleanup: and ntdsutil: prompts, type quit, and then press ENTER.

    7.To confirm removal of the domain controller:

    Open Active Directory Users and Computers. In the domain of the removed domain controller, click Domain Controllers. In the details pane, an object for the domain controller that you removed should not appear.

    Open Active Directory Sites and Services. Navigate to the Servers container and confirm that the server object for the domain controller that you removed does not contain an NTDS Settings object. If no child objects appear below the server object, you can delete the server object. If a child object appears, do not delete the server object because another application is using the object.