3 Replies Latest reply on Sep 7, 2014 4:50 PM by gregf

    Why is Session Data taking so long to restore at logon?

    gregf SupportEmployee
      Example output:



      1. Take an EM debug log
      2. Open in Log Parser
      3. Filter on 'session data' (no quotes)
      4. Copy and paste the Log Output into c:\temp\sessiondata.txt
      5. Run the following script
      $logfile = 'c:\temp\sessiondata.txt'
      
      $openKeys = get-content $logfile | Select-String -Pattern "\[Registry::ToKernelFormat\] key:"
      $closeKeys = get-content $logfile | Select-String -Pattern "\[SessionData::Restore\] Applied FBR->Registry, key "
      
      $startHash = @{}
      $durationHash = @{}
      
      $openKeys | %{
        if ($_ -match "L[0-9]  T[0-9]+ ([-]*[0-9]+).* key: (.*) sid:") {
          if (!$startHash.ContainsKey($Matches[2])) {
            $startHash.Add($Matches[2], $Matches[1])
          }
        }
      }
      
      $closeKeys | %{
        if ($_ -match "L[0-9]  T[0-9]+ ([-]*[0-9]+) \[SessionData::Restore\] Applied FBR->Registry, key (.*)") {
          $regKey = $Matches[2]
          $durationHash.Add($regKey,[math]::abs($startHash[$regKey] - $Matches[1]))
        }
      }
      
      $durationHash.GetEnumerator() | Sort-Object Value -descending | Select-Object -Property `
      @{Label="Reg Key";Expression={($_.Name)}}, @{Label="Duration (ms)";Expression={($_.Value)}} | Out-GridView -Title "Session Data Restore Times"