User Profile Service failed the logon

How to fix User Profile Service failed the logon error Microsoft Windows 7 and Windows Vista