And how to fix it when encountered while updating a SQL Server service account from Local System to anything else

Problem

I’ve recently had to work on a VM where the SQL Server Agent service account was changed from a dedicated service account to Local System. Trying to change the service account via the service properties window in SQL Server Configuration Manager, ended up throwing the “The parameter is incorrect [0x80070057]” WMI provider error.

In background: SQL Server Configuration Manager with the properties window for the SQL Server Agent opened.
In foreground: Error window "WMI Provider Error. The parameter is incorrect [0x80070057]

Cause

This tends to be a side-effect of setting the service account to Local System via Windows Services Manager (services.msc), instead of SQL Server Configuration Manager, and checking the “Allow service to interact with desktop” option.

SQL Server Agent service properties in services.msc with the "Local System account" radio button selected and with "Allow service to interact with desktop" checked.

Solution

Unchecking the “Allow service to interact with desktop” option and applying the change will then allow the successful update of the service account through SQL Server Configuration Manager without throwing that above error.

Key takeaway

Situations like the one that caused this error are among the reasons why Microsoft recommends that all changes to SQL Server related services be done from within SQL Server Configuration Manager.