Fix: Userenv event 1521 and Userenv 1511 errors in Windows Server 2003 Application log

The following events were listed in the Windows 2003 event log when one of our second level help desk staff connected to the server console via RDP:

Event 1521 Source Userenv 

Windows cannot locate the server copy of your roaming profile and is attempting to log you on with your local profile. Changes to the profile will not be copied to the server when you logoff. Possible causes of this error include network problems or insufficient security rights. If this problem persists, contact your network administrator.   

DETAIL – The network name cannot be found.
 
Event 1511 Source Userenv
 
Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.
 
The solution, as outlined in KB941339, is to delete the SID entries for the source user account from the following registry subkey:
 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
 
To determine the user’s SID, save the script found at
as a .vbs file.  
 
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
Set objAccount = objWMIService.Get _
    (“Win32_UserAccount.Name=’kenmyer’,Domain=’fabrikam'”)
Wscript.Echo objAccount.SID
 
Change the Win32_UserAccount.Name=’kenmyer’,Domain=’fabrikam
 
from kenmeyer and fabrikam to the user account in question and your domain name.

I saved the script as getsid.vbs.  Open a command prompt, and execute the script using cscript:

cscript.exe getsid.vbs

The script will display the SID associated with the user account specified.  Delete this from:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

to correct the Userenv errors.

Comments [4]

  1. Thank you so much, I have been searching for an article on this for weeks! It’s amazing how information and technology can get the best of us sometimes!

    1. Ok this worked for me in a different way. When the user was logged out the SID disappeared (it was released) however the error still remained, so what i did was:
      with the user logged in:
      1 – I exported (saved) the key wit the sid on
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

      2 – i deleted it

      3- had the user to logoff and reimported the key. If i delete the key and do not reimport the user was not able to login.

      4- when the user logged back in and the error disappeared.

Leave a Reply

Your email address will not be published. Required fields are marked *