This is the issue I have always seen with Windows Server Administrator. They face below issue a lot in their day to day activities while logging with their domain account. When they login with local account it was successful. The cause of this issue is simple, whenever computer joins into domain there is a computer account created in the Active Directory. This computer (devices) has password which is changed and sync with perspective machines every 30 days interval, if some how computer machine is not able to contact active directory (shutdown or network issue for more than 30 days or restore or manually reset computer password in Ad) you see this issue.
Another way: Resovled issue with PowerShell - Trust relationship Rejoin computers in domain without restart
To resolve the issue simple fix is to remove computer machine from domain, disjoin and rejoin the computer into Active Directory domain again, This could be a show stopper for few administrators due the requirement of the reboot requirement. This is big headache for IT admins specially with mission critical servers. Here PowerShell helps to solve this issue without a reboot.
The trust relationship between this workstation and the primary domain failed
Powershell will help in this regard and help to repair broken trust relationship (expired non synced password on Active Directory), without restarting server machine. To resolve the issue Log in with local admin account on the system and run Powershell open as administrator. There is separate AD credentials (permissions to join computer account machine to domain) are required to test the disjoined computer account machine. This doesn't require reboot.
Once command is executed the output should be True means successful. Sign out from local account and try logging with your Active Directory user account.
Test-ComputerSecureChannel -Repair -Credential (Get-Credential)
You can simulate and break trust relationship with reset computer account password in AD.
This is additional command if you don't want to use Powershell and normal cmd prompt command netdom can be also used to reset computer account password locally. You get message: The machine account password for the local machine has been successfully reset.
netdom resetpwd /server:domainserver /userd:domain\username /passwordD:*
Useful Articles
PowerShell HPE ILO4 Rest API automation examples
Powershell Configure ILO5 using Restful API
Configure Dell iDrac9 Rest API with Powershell
Powershell Dell iDrac redfish Rest API basic authentication
Powershell Convert range of numbers into another list of numbers maintaining ratio
PowerShell slice array into groups of smaller arrays
Powershell web scrapping extract table from html
Powershell adding leading zeros to string or int
PowerShell convert string to base64 value
PowerShell Encode or Decode an WebURL
Create an interactive HTML report with PowerShell data