Active Directory Series

🔑 Understanding Windows Logon and User Profiles from a "Top 1%" Perspective — Why the First Logon Needs Corporate Network Connectivity, and How VDI Differs

Introduction

This article is part of the Top 1% Series’ full article guide, and the third article in the Active Directory series.

Prerequisites

Getting the Big Picture

In a Nutshell

The first logon with a domain account requires corporate network connectivity because “that PC doesn’t yet possess any information capable of verifying whether the user really is who they claim to be.” On subsequent logons, the PC can use a “verification hint” it saved for itself during the first logon, letting it verify to a limited extent on its own even in situations where it can’t reach the network.

sequenceDiagram
    participant PC as Client PC
    participant DC as Domain Controller

    Note over PC: First logon (no credentials recorded on this PC yet)
    PC->>DC: Authentication request with username/password (Kerberos)
    DC-->>PC: Authentication succeeds, ticket issued
    Note over PC: ① A new user profile is created locally<br/>② A verification hash (cached credentials) is saved
    Note over PC: Subsequent logon (network connectivity available)
    PC->>DC: Authentication request as usual
    DC-->>PC: Authentication succeeds
    Note over PC: Subsequent logon (no network connectivity)
    PC->>PC: Matched against the saved verification hash (no query to the DC)

Fundamentals, Explained Thoroughly

What Happens on the First Logon

When a user tries to log on with a domain account to a domain-joined PC for the first time on that particular PC, that PC needs to be able to reach the corporate network (more precisely, a DC) for two reasons:

  1. Verifying the credentials itself requires querying a DC: The client PC itself holds absolutely nothing that would let it judge whether the username and password the user entered are correct (such as a password hash). That information exists only in AD DS, so the client needs to go through a Kerberos authentication exchange with a DC.
  2. A local profile dedicated to that user doesn’t exist on this PC yet: Once authentication succeeds, Windows newly creates a profile folder dedicated to that user under C:\Users\<username>. This is done by copying the contents of the default template folder at C:\Users\Default, and at this point, user-specific registry settings (such as the NTUSER.DAT file, which corresponds to HKEY_CURRENT_USER) are also newly generated.

In other words, the “heaviness” of the first logon comes from two distinct processes happening simultaneously: authentication itself (communication with the DC) and creating a brand-new profile (writing to the local disk).

Cached Credentials: What Happens Behind Subsequent Logons

When authentication succeeds, Windows simultaneously saves a hash value for verifying that user’s credentials to the local registry (a protected area). This is what’s called cached credentials (implemented as a hash format called MSCacheV2).

The key point here is that this cache doesn’t store the password itself, and the saved hash can’t be used to obtain a ticket for accessing other resources on the network (such as a file server). What cached credentials can be used for is strictly “deciding whether to allow a local logon (getting past the sign-in screen) on this PC itself.” The next time the PC can reach a DC, a proper Kerberos authentication is performed again, and the cache is refreshed to the latest state.

First logonSubsequent (network connectivity available)Subsequent (no network connectivity)
Credential verificationVerified via query to the DC (mandatory)Verified via query to the DCMatched against the local cache
Local profileNewly createdExisting profile is loadedExisting profile is loaded
Access to network resourcesWorks normallyWorks normallyNot possible (a Kerberos ticket can’t be obtained)
Settings to disable or limit cached credentials

The number of cached logon generations retained is controlled by the Group Policy setting “Interactive logon: Number of previous logons to cache (in case domain controller is not available)” (registry: CachedLogonsCount). By default, several generations of logon information are retained, but in environments with strict security requirements — where you don’t want to allow offline logon attempts at all in case a PC is stolen or lost, for example — this value can be set to 0 to disable the cache entirely. However, setting it to 0 means that nobody can log on to that PC at all in a situation where it can’t reach a DC (such as during a corporate network outage), so it’s a trade-off against availability.

Local Profiles Are Independent Per PC

As noted above, a local user profile is created on that PC’s local disk. So when the same user logs into a different PC, that PC doesn’t yet have a profile for that user, and an entirely new, empty profile gets created from scratch. The desktop wallpaper, saved documents, and application settings don’t carry over to the other PC at all. This — holding an independent profile per PC — is a basic property of Windows domain logon by default.

Roaming Profiles: Managing a Profile Centrally Over the Network

To address the need for “the same desktop environment even for a user who bounces between several PCs,” AD has long had a feature called roaming profiles. By setting a network share path (such as \\fileserver\profiles\%username%) as the profile path on the “Profile” tab of an AD user object, the profile’s contents get copied down to the local machine from that path at logon, and any local changes get copied back up to that network share at logoff. This achieves synchronization of the profile’s content across multiple PCs.

sequenceDiagram
    participant PC as Client PC
    participant Share as File share for profiles

    Note over PC: Logon
    Share-->>PC: Downloads (copies) the profile's contents
    Note over PC: Works using the local copy during the session
    Note over PC: Logoff
    PC-->>Share: Uploads (copies back) the changes

However, roaming profiles come with practical challenges too. As the profile grows larger (piling up a lot of files on the desktop, browser cache bloating, and so on), the copy process that runs on every logon and logoff takes longer, directly hurting the perceived speed. There’s also a well-known operational gotcha in the behavior when the same user is logged on to multiple PCs at once — the so-called “last write wins” problem, where the content from whichever PC logs off later ends up overwriting the rest.

How VDI (Virtual Desktop) Achieves “The Same Desktop From Any PC”

The experience of “reaching your familiar, personalized desktop no matter which device — a thin client or your desk PC — you connect from” in a VDI (Virtual Desktop Infrastructure) environment is a more thoroughgoing realization of the same idea behind roaming profiles. VDI broadly comes in two flavors:

Profile management in non-persistent VDI has traditionally relied on the roaming profiles described above, but in recent years, a newer approach called FSLogix (profile containers) has become the mainstream choice.

How FSLogix differs from roaming profiles

Roaming profiles copy a profile’s contents (a large number of small files) one by one over the network to the local machine at logon, which meant logon time grew in proportion to profile size — a well-known pain point. FSLogix instead holds each user’s entire profile as a single virtual disk file (VHD/VHDX) on a network share, and at logon, mounts that virtual disk file directly over the network, as-is. Rather than copying files one at a time, it mounts the profile as a disk directly, so logon time stays roughly constant even as profile size grows. This is widely adopted as a countermeasure against “logon storms” in VDI environments — the surge of simultaneous logons that happens right when everyone starts work in the morning.

Given all this, the hypothesis some engineers form — “VDI must let you reach your desktop from any PC by centrally managing user profiles” — is, broadly correct, but only for a non-persistent VDI + FSLogix (or roaming profiles) configuration. In persistent VDI, this kind of centralized management mechanism isn’t used at all — the profile simply continues to exist on a dedicated virtual machine, exactly as it would on an ordinary physical PC.

The View From the Top 1% Perspective

”First Logon Always Means Slow” Isn’t Necessarily True: Pre-Provisioning as an Option

In environments doing mass PC kitting (initial setup at scale), there’s often a desire to avoid having the heavy work of a first logon (authentication + brand-new profile creation) happen right at the moment a user first touches the PC. To address this, Windows offers synchronous provisioning and, combined with configuration management tools like SCCM/Intune, pre-provisioning mechanisms that let you complete template profile generation and pre-stage applications ahead of time, before the user actually starts using the device. In VDI environments too, similar techniques — such as baking an FSLogix container template directly into the non-persistent VDI’s master image — are a common way to improve perceived speed at first access, and are treated as a serious practical concern.

Enterprise State Roaming / OneDrive Sync: A Different Approach from Roaming Profiles

In recent years, an approach that selectively syncs only specific folders or settings, rather than the traditional roaming profile approach of copying the profile wholesale, has become widely used. Prominent examples include OneDrive’s Known Folder Move (which moves known folders like Desktop, Documents, and Pictures into OneDrive’s sync scope), and Microsoft Entra ID’s (formerly Azure AD) Enterprise State Roaming, which syncs things like browser favorites and some Windows settings via the cloud. Rather than syncing the entire profile wholesale as roaming profiles do, these can be understood as an approach that narrows the scope of what’s synced, avoiding the logon/logoff wait-time problem while still achieving a partial “same experience on any PC.”

Common Misconceptions and Pitfalls

The Troubleshooting Perspective

For logon- and profile-related issues, the basic approach is to first isolate whether the problem is an authentication issue or a profile issue.

  1. A PC that used to work fine now can’t be logged into during a corporate network outage: Check whether cached credentials are disabled (CachedLogonsCount is 0), or whether that user is actually attempting to log into that PC for the first time (in which case no cache exists yet).
  2. Logon succeeds, but the desktop is empty or looks unfamiliar: The roaming profile download may have failed, and a temporary profile may have been created instead. Check the event log for errors related to the “User Profile Service.”
  3. Logon takes an extremely long time (especially in VDI environments): Suspect a bloated roaming profile, or a logon storm (concentrated load on the file server/storage from everyone logging on at once at the start of the workday).
  4. In a VDI environment, previous settings didn’t carry over: In non-persistent VDI, check whether the profile container (FSLogix) mount failed, or whether the correct container is assigned to the correct user.

Preventive Measures and Permanent Fixes

Summary

What to Keep in Mind From Today

  1. When you run into an issue where “the first logon is slow / requires the network,” remember that two processes — authentication (communication with the DC) and brand-new profile creation — are running simultaneously.
  2. When designing or troubleshooting a VDI environment, first check whether it’s persistent or non-persistent, and if non-persistent, what profile sync approach (roaming profiles / FSLogix) it uses.

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).