How to fix «The specified account is unknown, the password is incorrect, or the user account does not have permissions to create this task» for Task Scheduler in Windows 10?

How did I fix it

Step 1

I renamed the PC from an automatic name «DESKTOP-GFK67RN» to «DMITRII-PC».

Step 2

I checked the new name using the whoami command:
2023-04-16--00-20-01

Step 3

I specified the whoami output («dmitrii-pc\dmitrii») as the user name, and my Microsoft account password, and it works!

2023-04-16--00-10-35