none
Blackscreen after logon RRS feed

  • Question

  • Hi

    We have a problem with logon times on our RDP 2012R2 servers. It must be related to the roaming profile.

    The problem:

    The users logon on via RDP. The profile gets loaded, applying group policy settings and so on, and then the "black screen" starts. I can take up to 15 minutes before the users desktop is visible and ready to work.

    While there are black screen I can press CTRL+ALT+DEL and go to the task manager. The only process that is working is explorer.exe.

    If we create a new profile the users are logged in less than a minute, but the logon process and the time for the black screen increases over time. It happens for all our users on our 30 RDS servers.

    Any suggestions?

    Friday, November 22, 2019 2:33 PM

Answers

All replies

  • HI
    "It must be related to the roaming profile."
    1.what's your internal local network bandwidth?
    2.what's size of the roaming user profile?
    3.is the user profile server and rds server in the same network segment and in the same AD domain?

    4.did you try to enable below policy on session host server ?
    local computer policy\ComputerConfiguration\administrative templates\system\userprofile
    wait for remote user profile  enable
    control slow network connection timeout for user profiles enable time to 0
    5.if you create a new domain user then logon the problematical RDSH,will the same problem happen on this new domain user ?
    6.can we find more related log about this issue?
    Troubleshoot user profiles with events
    https://docs.microsoft.com/en-us/windows-server/storage/folder-redirection/troubleshoot-user-profiles-events


    Best Regards
    Andy YOU
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.




    Monday, November 25, 2019 7:23 AM
    Moderator
  • Hi Andy

    Thank you for replying. 

    1) There is 10GB link between the file server where the profile is located and the RDS host session server. Out to the users desktop there is 1GB.

    2) I have tested different user profiles on different sizes: The result:

    Profile 1: (Size 488MB)
    Logon: 00:00
    Black screen starts: 00:36
    Desktop ready: 03:58

    Profile 2: (Size 178MB)
    Logon: 00:00
    Black screen starts: 00:11
    Desktop ready: 01:43

    Profile 3: (Size 3,15 GB)
    Logon: 00:00
    Black screen starts: 01:49
    Desktop ready: 02:21

    Profile 4: (645 MB)
    Logon: 00:00
    Black screen starts: 00:44
    Desktop ready: 02:30

    The time between "Logon" and "Black screen starts" gets higher the larger the profile is. I makes sense because its here where the profile gets loaded and GPs applying. But the time on the black screen afterwards differs.

    3) Yes, they are in the same network segment and same AD domain.

    4) I tried to enable these policies. That did not make any difference.

    5) No, the login will be fast in the beginning. But over time i will slow down. Just if I create a new profile on an existing user.

    6) There is no error in the Application log and System log. In the User Profile Service Operationel log the log stops when the profile is loaded. There is no event log entries during the black screen.
    If I enable diagnostics logs the last entry I get is: "New user profile creation complete.". The timestamp is where the black screen starts.

    Any comments/suggestions? I wil try to remove different directories from the profile on the profile server and see if that removes the black screen.

    I found a workaround... a "bad" one :) When the black screen start press CTRL+ALT+END. Click Task Manager. End the explorer.exe task and start afterwards, and then I see the desktop. 

    Tuesday, November 26, 2019 9:14 AM
  • By the way..

    Windows Explorer uses ~ 25% during the black screen

    Tuesday, November 26, 2019 10:05 AM
  • After some more tests with deleting folders and files from the roaming profile, I am nom certain that the problem is in the NTUSER.DAT file.

    My current file is 2560 kb and then the full login time takes about 4 minutes.

    If I replace the file with a NTUSER.DAT from at newly created profile the size is 512 kb and the logon time is 25 seconds.

    But then many settings are gone.

    How can I debug, so I can find out what takes time/is wrong in the NTUSER.DAT file.


    Tuesday, November 26, 2019 10:50 AM
  • HI
    7.when the slow log on problem first happen ?
       did roaming profile work fine on w2012 r2 rds server before ?
    8.did you install full patch on w2012 rds server ?
    there are 2 document for your reference.
    Slow logon for roaming profiles on Server 2012 R2
    https://social.technet.microsoft.com/Forums/office/en-US/04deb42c-8f1f-4695-9e10-56d2689f5c40/slow-logon-for-roaming-profiles-on-server-2012-r2?forum=winserver8gen
    Group Policy Recommendations for Roaming User Profiles
    https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc781862(v=ws.10)?redirectedfrom=MSDN

    Best Regards
    Andy YOU
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Tuesday, November 26, 2019 2:53 PM
    Moderator
  • Hi

    Thanks for coming back so quickly.

    7) I have been working here for 3 years, and it has been a problem since I started. I can't say when it started.

    8) Yes, they are fully patched. We patch once a month. 

    The first link... I don't see "Event ID 5: Kernel-General :: {Registry Hive Recovered}" in Event Viewer in my environment.

    So why do you link to that thread? They are talking about reseting the profile. Yes, I could reset/create a new profile for 200 users. That would be time consuming workaround, and I know by experience that after some time I will see slow logins again. If I copy a default NTUSER.DAT file lots of settings will get lost.

    The second link... The article applies to Windows Server 2003.. Anyway, I have read it and checked.

    Delete cached copies of roaming profiles - We do that
    Limit profile size - We don't do that. But we see problems on both small and large profiles. So it isnt relevant.
    Exclude directories in roaming profile - We alreay have a long exclude list. And I have already narrowed the problem down to the NTUSER.DAT file.
    Always wait for the network at computer startup and logon - Not relevant.
    About loopback processeng - We only use the roaming profile on 2012 R2 servers.

    I have read through the settings in table 7.6. I don't see any settings that makes sense to apply or disable.

    Wednesday, November 27, 2019 10:34 AM
  • HI

    9.what's the size of ntuser.dat for the new user(testa) first logon the RDSH?
      what's the size of ntuser.dat for the new user(testa) second logon the RDSH?
    C:\users\testa\
    ntuser.dat
    10.How can I debug, so I can find out what takes time/is wrong in the NTUSER.DAT file?
    can we find a an thread from userenv.log ?
    To create a detailed log file for user profiles
    In the Run dialog box, type regedit, and then click OK.
    Locate the following subkey: HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon.
    Create a new entry named UserEnvDebugLevel of data type REG_DWORD, and set its value to 0x30002.
    The log file is stored in this location: %windir%\Debug\Usermode\Userenv.log.
    https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc738596(v=ws.10)

    11.Writing the NTUser.dat happens during login; essentially, it’s a copy of the Windows Registry’s HKEY_CURRENT_USER hive.
    can we can find which registry very large in 
    HKEY_CURRENT_USER registry so that is cause your NTUser.dat lager for each user ?
    there is a documents for your reference
    The size of the "HKEY_USERS\.DEFAULT" registry hive continuously increases on a Windows Server-based server
    https://support.microsoft.com/en-us/help/2871131/the-size-of-the-hkey-users-default-registry-hive-continuously-increase

    Understanding NTUser.dat in Windows 10
    https://searchenterprisedesktop.techtarget.com/blog/Windows-Enterprise-Desktop/Understanding-NTUserdat-in-Windows-10


    Best Regards
    Andy YOU
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Wednesday, December 4, 2019 6:20 AM
    Moderator
  • HI
    Is there any progress on your question?

    Best Regards
    Andy YOU
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, December 6, 2019 6:06 AM
    Moderator
  • Yes, I try to keep up with your questions :)

    9) First login on testa = 512 kb and second login = 768 kb.

    With this testa user the login process is fast both the first and the second time. When I say it gets worse over time, I mean typically > 1-2 months.

    With an account recreated 3 months ago the login takes time. The NTUSER.DAT size here is: 2560 kb

    10) 

    I have enabled debug and logged in with an account that takes time. The same I refered to earlier that was recreated 3 months ago.

    Login: 12:38:00 (hh:mm:ss)
    Goes to black screen: 12:38:34
    Desktop ready: 12:42:44

    The log userenv.log file has its first timestamp 12:38:02:369 and last timestamp 12:38:34:546.

    I can attach the log if interrested? The log does not write anything during the black screeen.

    11)

    The "HKEY_USERS\.DEFAULT\Printers\DevModes2" only contains the Default string entry in my profile. So I guess this is not the problem.

    The links mentions compresseing bloated HKLM. But the it seems to be a user specific issue. Becasue the login times differs on each user I try with.

    In the last link "Understanding NTUser.dat" the conclusion is don't mess with the file :) My conclusion is that my black screen dissappers if I copy af "fresh" NTUSER.DAT file into a profile that has long login times.

    Friday, December 6, 2019 12:14 PM
  • HI

    12. “First login on testa = 512 kb and second login = 768 kb.
    With this testa user the login process is fast both the first and the second time. When I say it gets worse over time, I mean typically > 1-2 months.“
    from your description ,i think we need to test below condition for this testa user.
    if we don't change any settings in testa's profile and RDS server then only logon and logoff this testa user account , repeat this same operation. will the ntuser.dat of testa growth continuously ?
    C:\users\testa\ntuser.dat

    13."Writing the NTUser.dat happens during login; essentially, it’s a copy of the Windows Registry’s HKEY_CURRENT_USER hive."
    can we can find which registry very large in HKEY_CURRENT_USER registry so that is cause your NTUser.dat lager for each user ?
    1)download and install process monitor v3.5 on problematical server on domain admin account
    2)Open the process monitor, press “Ctrl+E” to “suspend” it, “Ctrl+X” to clear present process information.
    3) Press “Ctrl+E” to start the process monitor again.
    4) try to use testa to logon the RDSH and wait this account log on successfully then Press “Ctrl+E” to “Suspend” it again then save the present log(Ctrl+S).save all event as testa.pml
    5) open the logfile.pml to check which registry load more.
    https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

    "With an account recreated 3 months ago the login takes time. The NTUSER.DAT size here is: 2560 kb"
    can you collect testb.pml for this 3 month ago account by using the same above method.
    "If I enable diagnostics logs the last entry I get is: "New user profile creation complete.". The timestamp is where the black screen starts."
    if we can know The timestamp is where the black screen starts, we can open to the testb.pml and look which registry is loading at that time.
    we can also try to compare testa.pml and tesb.pml then try to discover which registry of testb is lager than testa  and find other thread?
    we can also try to compare old testa.pml and new tesa.pml then try to discover which registry of new testa is lager than old testa and find other thread?




    Best Regards
    Andy YOU
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.



    Monday, December 9, 2019 6:49 AM
    Moderator
  • Hi
    we have the exact same problem with our 2016 RDS Farms. (700 users / 40 servers).
    For some months (September?) the user get a black screen for the second half of his logon + logon duration > 30 seconds.
    - RDS Server 2016, Clients W10 - all with current patches.

    BUT - We tested the dependencies on the size of the NTUSER. DAT file. Sorry - no dependency in our case. But really the same problem symtome.




    Wednesday, December 11, 2019 10:15 AM
  • (Search for UFH\SHC with goo…. bing.)

    REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\UFH\SHC /f

    put in in your Logoff Script 

    This will do the job.

    Friday, December 13, 2019 2:31 PM
  • (Search for UFH\SHC with goo…. bing.)

    REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\UFH\SHC /f

    put in in your Logoff Script 

    This will do the job.

    Thank you very very much. This works :)
    Monday, December 16, 2019 9:34 AM