After I got this message in Management Shell, I tried to open the Central Admin site, which greeted me with another error message:
"Server Error in '/' Application.
This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database. ..."
So I went further towards SQL...
In my case the reason was that the config database has been corrupted (by power outage). It's sign was a word "(Suspect)" next to the database's name in SSMS.
One way to fix this:
-- Use the Master database
Use Master
-- Verify that database has issues
EXEC sp_resetstatus 'SharePoint_Config'
-- Put the database in emergency mode
ALTER DATABASE SharePoint_Config SET EMERGENCY
DBCC checkdb('SharePoint_Config')
-- Set the database in single user mode
ALTER DATABASE SharePoint_Config SET SINGLE_USER WITH ROLLBACK IMMEDIATE
-- Repair the database with data loss
DBCC CheckDB ('SharePoint_Config', REPAIR_ALLOW_DATA_LOSS)
-- Set the database in multi-user mode
ALTER DATABASE SharePoint_Config SET MULTI_USER
-- Verify that database is reset
EXEC sp_resetstatus 'SharePoint_Config'
Found on Nik Patel's site
https://nikpatel.net/2011/03/02/sharepoint_config-suspect-mode-cannot-connect-to-the-configuration-database-error/