Search Indexing Repair on RDS Server 2019 2022

Windows Server 2019 users find that when searching in RDS, the search indexing on the terminal server do not work while searching in remote desktop and in Outlook.

Symptom

Windows Server 2019 users reported that searching in Remote Desktop on the Terminal Server and searching in Outlook doesn’t showing any search results. The status “Indexing is not running” is displayed in the indexing options.

Search Indexing Repair on RDS Server, Indexing Options
The status “Indexing is not running” is displayed in the indexing options.

After checking the search indexing service “services.msc”, it is shown that Windows Search is running on the RDS Server 2019. When trying to Rebuild the index under Advanced “Rebuild”, the indexing remains unsuccessful even after this action.

Cause

Starting with Windows Server 2019, Microsoft has made changes to the Windows Search service. The per-user search index is now enabled by default. This search indexing also applies to RDS and Windows Server 2022.

That’s why, as an administrator, you won’t see any locations under Indexing Options > Change > Show all locations.

Administrators can disable the setting and restore the older indexing method for Windows Server and RDS by using the EnablePerUserCatalog registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search
DWORD EnablePerUserCatalog 0

Solution: Search Indexing for RDS server

The traditional indexing option “per user search indexing” is restored with the following action.

To do this, open a command prompt on the windows server as an administrator and execute the following command to add the registry DRWOD key EnablePerUserCatalog with the value 0.

REG ADD "HKLM\SOFTWARE\Microsoft\Windows Search" /v "EnablePerUserCatalog" /t REG_DWORD /d "0" /f

Now restart the “Windows Search” service or Reboot the Windows Server.

Now all locations are displayed (such as Outlook and/or OneNote). In addition, the number of indexed items should increase significantly.

Search Indexing Repair on RDS Server 2019 2022

Note: In Indexing Options > Advanced, the locations of the index can be specified and Rebuild if necessary.

Windows Search Indexing in Server 2019, 2022 using Multi-Session

Now, the default Windows Search service is able to roam all Windows Search index data on a per-user basis. The most significant change of per-user search indexing is that the Windows Search index is now stored per user in the user profile, under the following path:

C:\Users\%Username%\AppData\Roaming\Microsoft\Search\Data\Applications{UserSID}{UserSID}.edb

On each login, the Windows Search process creates a new instance of the search database for the user based on the existing EDB. If no EDB file exists, a new one is created by the Operating System.

Enable Windows Search Service on RDS Server

Log in to the Windows Server 2019 or 2022 and launch the Server Manager. Click Manage and select Add Roles and Features. Select Role based or feature-based installation option and click Next, walk through until the Features page, select the Windows Search Service checkbox and click Next. On the Confirmation page, click Install.

Now the windows search service just needs to be started, this is done from services.msc, open windows search properties, select startup type Automatic (Delayed Start), then click the Start button.

Windows Search Properties on Windows Server 2019
Windows Search Properties on Windows Server 2019

Install Windows Search Service in PowerShell

Using PowerShell is probably the quickest way to install the Windows Search service on a server. Launch the PowerShell as administrator. Run the following PowerShell command to install the Windows Search service on Windows Server.

Install-WindowsFeature Search-Service

Open Windows Indexing Options

To access the indexing options, enter “indexing” in the search field.

Alternatively, you can press the key combination Windows-Logo+R.
A new “Run” window will then open. Type the command control srchadmin.dll and select OK.

Open Windows Indexing Options

Windows Search Indexing

Indexing is the process of looking at files, email messages, and other content on your PC and RDS Server and cataloging their information, such as the words and metadata in them. When you search your Computer after indexing, it looks at an index of terms to find results faster.

When you first run indexing, it can take up to a couple hours to complete. After that, indexing will run in the background on your PC or RDS Server as you use it, only re-indexing updated data.

Note. if you are considering using single user search roaming or multi-user search roaming, follow this Microsoft article.

Fix DNS /etc/resolv.conf systemd-resolved

DNS resolution of /etc/resolv.conf and systemd-resolved doesn’t work after upgrade Ubuntu or Linux Mint.

How to Fix DNS resolution using systemd-resolved and /etc/resolv.conf after upgrade

Fix DNS /etc/resolv.conf systemd-resolved

Symptom: Could not resolve hostname. Name or service not known

After upgrading Ubuntu or Linux Mint querying DNS resolution fails. It seems the DNS servers which get by DHCP doesn’t work anymore.

Name resolution

resolvconf is a set of script and hooks managing DNS resolution. The most noticeable experience for the user is that any changes made manually to /etc/resolv.conf will be lost as they will be overwritten the next time resolvconf is triggered. resolvconf uses DHCP client hooks, a Netplan NetworkManager plugin and /etc/network/interfaces to generate a list of nameservers and domain to put in /etc/resolv.conf.

DNS client configuration

Traditionally, the file /etc/resolv.conf was a static configuration file that rarely needed to be changed, also it automatically changed via DHCP client hooks. systemd-resolved handles nameserver configuration, and it should be interacted with through the systemd-resolve command. Netplan configures systemd-resolved to generate a list of nameservers and domains to write in /etc/resolv.conf, which is a symlink:

/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

Note. Ubuntu Server network interface configuration utility is ifup and it is configured by the file /etc/network/interfaces.

Ubuntu Gnome Desktop or Linux Mint Mate or Cinnamon the network interface configuration is by Netplan configure utility.

DNS Resolution /etc/resolv.conf systemd-resolved

The Netplan NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces.

Netplan NetworkManager is also configured by Edit Connections in the graphical network connection utility. However, for network interfaces configured by DHCP it normally isn’t necessary to change any settings manually.

If you are considering to configure the DNS resolution manually, you must first change the NetworkManager.conf file.

$ sudo vi /etc/NetworkManager/NetworkManager.conf

default: NetworkManager will update /etc/resolv.conf to reflect the nameservers provided by currently active connections.

[main]
plugins=ifupdown,keyfile
# Set to default DNS processing mode.
dns=default

Add dns default key to the main section in the NetworkManager.conf file.

If the key is unspecified, default is used, unless /etc/resolv.conf is a symlink to /run/systemd/resolve/stub-resolv.conf, /run/systemd/resolve/resolv.conf, /lib/systemd/resolv.conf or /usr/lib/systemd/resolv.conf. In that case, systemd-resolved is chosen automatically.

Now restart network management daemon to apply changes.

$ sudo systemctl restart NetworkManager

After an os upgrade, the symlink may need to be recreated. Make symlink to /run/systemd/resolve/stub-resolv.conf

$ sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Restart systemd-resolved DNS Network Name Resolution manager.

$ sudo systemctl restart systemd-resolved.service

Verify DNS Resolution using systemd-resolved /etc/resolv.conf

Verify processing and also oprations of Network Name Resolution.

$ journalctl -b -u systemd-resolved

Check DNS status of systemd-resolved Network Name Resolution.

$ resolvectl status

Using resolvectl command to resolve domain names, IPv4 and IPv6 addresses.

$ resolvectl query google.com

Set DNS Resolver completely manually

If you want to configure the DNS resolution manually, you must first change the NetworkManager.conf file.

$ sudo vi /etc/NetworkManager/NetworkManager.conf

Change NetworkManager configuration dns key to none.

dns=none

Now is a good moment to verify the NetworkManager settings.

$ NetworkManager --print-config

Apply changes of network management daemon.

$ sudo systemctl reload NetworkManager

Unlink resolv.conf symlinked to /run/systemd/resolve/stub-resolv.conf.

$ sudo unlink /etc/resolv.conf

Stop and disable systemd-resolved Network Name Resolution manager.

$ sudo systemctl stop systemd-resolved.service
$ sudo systemctl disable systemd-resolved.service

Manually configuring the /etc/resolv.conf file

Create new or edit existing /etc/resolv.conf file.

$ sudo vi /etc/resolv.conf

Add the following lines in to the /etc/resolv.conf file.

nameserver 8.8.8.8
nameserver 1.1.1.1
nameserver 1.0.0.1
options edns0 trust-ad
search localdomain

Note. The number of name servers is limited to 3 nameserver.

Finaly verify DNS name resolution.

$ resolvectl query ntp.pool.org
ntp.pool.org: 216.40.34.37                     -- link: ens160

-- Information acquired via protocol DNS in 13.0ms.
-- Data is authenticated: no

$ resolvectl status

$ dig ns1.google.com

; <<>> DiG 9.16.48-Ubuntu <<>> ns1.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45042
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;ns1.google.com.                        IN      A

;; ANSWER SECTION:
ns1.google.com.         18466   IN      A       216.239.32.10

;; Query time: 6 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue May 28 12:53:01 CEST 2024
;; MSG SIZE  rcvd: 59

what does systemd-resolved do?

systemd-resolved is a system service that provides network name resolution to local applications. It also implements a caching and validating DNS/DNSSEC stub resolver, as well as an LLMNR and MulticastDNS resolver and responder. Local applications may submit network name resolution requests via three interfaces:

systemd-resolved maintains the /run/systemd/resolve/stub-resolv.conf file for compatibility with traditional Linux programs. This file may be symlinked from /etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see above) as the only DNS server. It also contains a list of search domains that are in use by systemd-resolved. The list of search domains is always kept up-to-date. Note that /run/systemd/resolve/stub-resolv.conf should not be used directly by applications, but only through a symlink from /etc/resolv.conf.

A static file /usr/lib/systemd/resolv.conf is provided that lists the 127.0.0.53 DNS stub as only DNS server. This file may be symlinked from /etc/resolv.conf in order to connect all local clients that bypass local DNS APIs to systemd-resolved. This file also does not contain any search domains.

more help get also the man pages
$ man systemd-resolved.service
$ man NetworkManager.conf
$ man NetworkManager
$ man resolv.conf
$ man resolvectl