Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

'The User Profile Service failed the logon' and event 1511 temporary profiles on Remote Desktop hosts

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A user who is signed in to a temporary profile, or refused with "The User Profile Service failed the logon. User profile cannot be loaded.", has hit a failure in the Windows profile service. Microsoft documents two separate cases. For the temporary profile (event 1511) the causes it gives are a corrupt local profile, lost permissions on the profile folders, a profile folder deleted by hand while its registry entry stayed, and antivirus scanning at sign-in. For the "failed the logon" message on Windows 8.1 and Windows Server 2012 R2 with roaming profiles after the April 2014 update, it gives one cause, covered below. The Application log shows which case you have.

Read the events first, check the user's entry in the ProfileList registry key, and fix the cause that matches. Do not delete anything until a copy of the user's files exists.

What the error means

Microsoft's page for event 1511 gives the event details as ID 1511, source Microsoft-Windows-User Profiles Service, and a message that reads "Windows cannot find the local profile and are logging you on with a temporary profile. Changes you make to this profile will be lost when you log off." That page applies to Windows 7, Windows 8, Windows Server 2008 R2 and Windows Server 2012. The page is marked archived and shows the date 2024-01-17.

A temporary profile is a profile that exists only for the session. Anything the user saves into it is lost at sign-out, which on a Remote Desktop Session Host means a user can work for hours and lose everything.

Microsoft documents a separate message for another scenario. After the April 2014 update for Windows 8.1 and Windows Server 2012 R2, users on Windows 8.1 computers who use roaming profiles could not sign in for the first time, and received "The User Profile Service failed the logon. User profile cannot be loaded." The same page shows two events that accompany it: event 1509 (source Microsoft-Windows-User Profiles General, a warning that Windows cannot copy a file from the roaming profile share, with the detail that the file is in use by another process) and event 1500 (source Microsoft-Windows-User Profiles Service, an error: "Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly."). The documented cause is Microsoft Application Virtualization 5.0 Service Pack 2, and the remedy is Hotfix Package 5 for it.

Event 1530 ("The Windows operating system detected that your registry file is still in use by other applications or services") looks alarming, but Microsoft's page says "No user action is required - this is an acceptable condition".

Likely causes

Cause What you see How to confirm
Profile folder deleted by hand or by a clean-up script Event 1511; the user's SID remains in ProfileList Read ProfileImagePath for the SID and test that the folder exists
Corrupt local profile Event 1511 The folder exists but the profile fails to load; read the events around the sign-in time
The user lost permissions to the profile folders Event 1511 Compare the folder permissions with a working profile
Antivirus scanning while the user signs in Event 1511 at a time when a scan is running Compare the event time with the scan schedule
Roaming profile with App-V 5.0 SP2 after the April 2014 update "failed the logon" message, events 1509 and 1500 App-V version installed, roaming profile in use, Windows 8.1 or Server 2012 R2
Event 1530 only A warning or information event at sign-out Nothing to fix
FSLogix container is not attaching FSLogix Reason 7, "Profile is a Windows temporary profile" The user's Reason value under the FSLogix Sessions key

Prove the cause before changing anything

All of these only read. Run them on the Remote Desktop host, in an elevated window.

1. Read the events. Microsoft's Learn page shows the events in the Application log. Use Get-WinEvent with a hash table filter, whose documented keys include LogName, ProviderName, ID and StartTime:

$StartTime = (Get-Date).AddDays(-2)
Get-WinEvent -FilterHashtable @{
  LogName='Application'
  ProviderName='Microsoft-Windows-User Profiles Service'
  ID=1511
  StartTime=$StartTime
}

Repeat with ID=1500 for the load failure. Event 1509 comes from the provider "Microsoft-Windows-User Profiles General". A good result is no 1511 or 1500 events for the user at the time of the sign-in. A bad result is an event naming the user at that time.

2. Find the user's SID. In the user's own session, whoami /user displays the current domain, user name and SID. The event's own User field gives the same account.

3. Read the ProfileList entry. The profile list lives at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. Read it without changing it:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*"

Wildcards are permitted in the path. Find the SID and read its ProfileImagePath. Microsoft's explanation for event 1511 is that when the SID is present, Windows tries to load the profile from the ProfileImagePath, and if that path does not exist, the profile cannot load. Test the folder named there exists.

4. For an FSLogix host, read the user's Reason value under HKLM\Software\FSLogix\Profiles\Sessions\<SID>. Reason 7 is documented as "Profile is a Windows temporary profile", which sends you back to steps 1 to 3.

Example (illustrative): on rds02 a clean-up script frees space on the 120 GiB data volume by deleting D:\Users\mkhan, an 18 GiB folder that it wrongly judged abandoned. The volume falls from 96 GiB used (80 percent) to 78 GiB (65 percent). At the next sign-in CONTOSO\mkhan receives event 1511, and ProfileImagePath for mkhan's SID points to a folder that no longer exists. That is the first row of the table. The fix is to remove the stale entry after exporting the key, and to restore mkhan's files from backup into the new profile.

Fix

Choose the fix for the cause you proved.

A single sign-in failure with no clear cause. Microsoft's first resolution is to restart the computer and sign in again.

Disruptive step: restarting a Remote Desktop Session Host ends every user's session on it, and unsaved work is lost. Choose a time with no one connected. There is no way back for work that was open.

Deleted or corrupt profile (stale SID entry). Microsoft's steps are: delete the profile through System Properties (Advanced tab, User Profiles, Settings), remove the SID under ProfileList, and sign in to create a new profile.

Disruptive step: Deleting a profile in the User Profiles dialog removes the user's files and settings from the host, with no way back except a copy. Copy anything needed out of the profile folder first.

Disruptive step: Deleting the SID key in ProfileList is a registry change. Export the key first, using the form Microsoft's RDP page shows for a registry backup:

reg export "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" C:\ProfileList-backup.reg

To back out, import the saved .reg file. The next sign-in creates a new profile, so restore the user's files from your copy into it.

Lost permissions. Restore the user's rights to the profile folders. Microsoft's page lists this as a cause and does not give a command, so compare with a healthy profile folder on the same host.

Risk: changing permissions on a profile folder changes who can open the user's files. Impact: a wrong entry can lock the user out or expose the folder to others. Back-out: record the folder's existing permissions before the change (for example with the Security tab or a saved copy of the listing) and put them back if the sign-in does not improve.

Antivirus scanning at sign-in. Microsoft says occasionally Windows might not read the profile correctly because of scanning. The page gives no exclusion setting. Ask the antivirus vendor for the supported exclusion for profile files and test with one user.

Risk: an antivirus exclusion on a Session Host stops scanning of the excluded files for every user. Impact: malware in the excluded location is not scanned. Back-out: remove the exclusion after the test with one user if the sign-in does not improve, and keep it limited to the vendor's supported scope.

Roaming profile after the April 2014 update. Install Hotfix Package 5 for Microsoft Application Virtualization 5.0 Service Pack 2 on every computer where the fault occurs, as Microsoft's page directs.

Risk: this installs software on every affected computer. Impact: a fault in the hotfix then affects all of them at once. Back-out: install it on one test computer first. Microsoft's page does not describe an uninstall route, so there is no documented way back; check the hotfix package's own documentation for one before rolling it out.

FSLogix with temporary profiles allowed. FSLogix has a setting, PreventLoginWithTempProfile (DWORD, default 0). When set to 1, FSLogix loads the FRXShell if it determines that a temp profile was created, and the user's only option is to sign out.

Risk: this stops affected users from working at all until the cause is fixed. It protects them from saving into a profile that disappears. To back out, set it to 0.

Confirm the fix

Have the user sign in again. Check that no new event 1511 or 1500 appears for the sign-in time, and that the user's profile folder now exists at the ProfileImagePath the registry names. Ask the user to save a test file, sign out, and sign in again to confirm it persists, which proves the profile is not temporary.

What to watch afterwards

  • Search the Application log weekly for event 1511 on every Session Host, so a new case is seen before the user loses work.
  • Do not delete profile folders by hand. Microsoft notes that a manually deleted profile does not remove its SID from the profile list.
  • Ignore event 1530 on its own, as Microsoft's page directs.

Risks and limits

These commands have not been run or lab-tested. The event 1511 and event 1530 pages are archived and written for Windows 7 to Windows Server 2012, so steps and wording on current releases can differ. The "failed the logon" page covers one roaming profile fault and does not describe other causes of the same message.

Microsoft's pages on these events do not document event 1515 or a ProfileList key whose name ends in .bak, so there are no steps here for either. Do not edit ProfileList beyond what a backed-up, single-user fix needs.

Sources