I apologize for my previous response as it seems to have overlooked some specific details from your previous inputs.
As you mentioned that LSASS is iterating through every user account in the registry and this behavior is not present in Windows Server 2012 R2, the difference might be due to the changes that Microsoft added to the newer versions of Windows Server, in this case Windows Server 2019 and 2022. It is possible that these iterations are designed to enhance various aspects of security or other updates, so it might not be just an issue of stopping LSASS from doing this.
Given that Windows Server is designed to handle such scenarios with Active Directory implementations rather than using an excessive number of local user accounts, I recommend evaluating the feasibility of implementing Active Directory or other centralized authentication and user management services like LDAP to avoid such issues in the future.
Unfortunately, there may not be a simple registry tweak to disable LSASS's behavior. Still, migrating away from a large number of local user accounts and using Active Directory or LDAP can enhance your server's performance and security.
As you mentioned that LSASS is iterating through every user account in the registry and this behavior is not present in Windows Server 2012 R2, the difference might be due to the changes that Microsoft added to the newer versions of Windows Server, in this case Windows Server 2019 and 2022. It is possible that these iterations are designed to enhance various aspects of security or other updates, so it might not be just an issue of stopping LSASS from doing this.
Given that Windows Server is designed to handle such scenarios with Active Directory implementations rather than using an excessive number of local user accounts, I recommend evaluating the feasibility of implementing Active Directory or other centralized authentication and user management services like LDAP to avoid such issues in the future.
Unfortunately, there may not be a simple registry tweak to disable LSASS's behavior. Still, migrating away from a large number of local user accounts and using Active Directory or LDAP can enhance your server's performance and security.