Event 1511 After Cleaning Your VDA’s Master Image

So you’ve done a nice job cleaning up your VDA. You’ve optimized, removed extra user profiles and even ran cleanmgr to cleanup your system’s 2 GB+ of old updates. You deploy the image… and get a message that you’ve been logged on with a Temporary Profile. A look at the Event Logs leads you to Event 1511. Here’s what’s going on in most cases.

Event 1511: Temporary Profile

If someone has done the cleanup of profiles manually (or in the case of PVS, mounted the vDisk and manually removed the user directories- a mistake I have made in the past as well) and either local or Microsoft Roaming profiles was used in the image… you may get an Event 1511, User Profile Service – “Windows cannot find the local profile and is logging you in with a temporary profile…”

Event 1511
Why?
Because when you simply delete the files Windows still has a record of those profiles and wants to see them! When it can’t, rather than just creating a new directory it creates a temporary profile. I assume this is to prevent corruption if you restore the profile somehow.

Fixing Event 1511

In your master image, launch Regedit. Navigate to
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

There you’ll see a list of profiles Windows expects to see. Remove all the relevant keys by looking at the ProfileImagePath. Delete all the keys corresponding to the profiles you removed ONLY. Do not remove any of the system Profile GUIDs!

Preventing Event 1511 in the Future

The proper way to remove profiles from the system is to go Control Panel->System->Advanced System Settings and click Settings under User Profiles. From there, you will see the local profiles and can select and delete the proper ones. The focus will typically be on domain accounts- and you’ll typically see all the administrators that have logged into your image since the last time it was properly cleaned.

IMPORTANT:
DO NOT remove the service account you are using or the Citrix Telemetry Service account. Leave any service accounts for backups. I will typically go ahead and remove Administrator profiles as they can often get very large. The system will not allow you to remove your own profile, so if you are logged in as a domain account, consider logging in as a local service account and removing your domain profile that way.

But what about when profiles may be current and should be saved? Thanks to my friend, CTP and industry powerhouse Helge Klein, we have a tool that can take care of pruning profiles called DelProf2. This is an update to a prior tool called DelProf. BTW- if you use Splunk you should ABSOLUTELY check out his UberAgent for Splunk!!
If you are running persistent servers (as in, not MCS or PVS) then this tool is a must in your toolkit.

This tip is brought to you by the official CTXPro Membership. Get on the waiting list with free tips and tricks while you wait at https://ctxpro.com/membership

Got a different way to deal with this problem? There’s always more than one way! I’d love to hear about it in the comments so I can include it in the text!