When trying to set the search settings via CSOM in SP2016 I received the following Error:
retrieving the com class factory for component with clsid {0ff1ce16-0005-0000-0000-000000000000} failed due to the following error: 800703fa illegal operation attempted on a registry key that has been marked for deletion.