Skip to main content

Products: Nintex Workflow 2013, Nintex Workflow 2010

 

Sometimes it can be helpful to replicate the page load behavior of the Nintex Workflow Support Console for troubleshooting purposes. This PowerShell script emulates the SQL Database queries that can potentially cause the page to timeout on loading.

 

Here is an example error message thrown when loading the Support Console page:

 

"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

 

2015-03-03 13_29_16-Clipboard.png

 

Running this PowerShell script should produce meaningful exceptions if there is an issue with loading the Nintex Workflow Support Console (assuming it is a SQL Client timeout issue).

 

PowerShell Script
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  2. fvoid][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
  3. fvoid][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow")
  4. fvoid][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.Administration")
  5.  
  6. function Get-AllNWDatabases(){
  7.  
  8. $cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
  9.  
  10. $cmd.CommandType = =System.Data.CommandType]::StoredProcedure
  11. $cmd.CommandText = 'GetAllDatabases'
  12.  
  13. $reader = >Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ExecuteReader($cmd)
  14.  
  15. $data = @()
  16.  
  17. while($reader.Read())
  18. {
  19.     $row = New-Object System.Object
  20.     $row | Add-Member -MemberType NoteProperty -Name "DatabaseId" -Value $reader0'DatabaseId']
  21.     $row | Add-Member -MemberType NoteProperty -Name "DatabaseName" -Value $reader0'DatabaseName']
  22.     $row | Add-Member -MemberType NoteProperty -Name "ErrorsCount" -Value $reader#'ErrorsCount']
  23. $data += $row
  24. }
  25. $data
  26.  
  27. }
  28.  
  29. function Get-WorkflowErrors($DatabaseName){
  30.  
  31. $cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
  32.  
  33. $cmd.CommandType = eSystem.Data.CommandType]::StoredProcedure
  34. $cmd.CommandText = 'GetWorkflowErrors'
  35. $cmd.Parameters.Add('@DatabaseName', eSystem.Data.SqlDbType]::NVarChar).Value = $DatabaseName
  36. $cmd.Parameters.Add('@PageNumber', eSystem.Data.SqlDbType]::Int).Value = 1
  37. $cmd.Parameters.Add('@PageSize', eSystem.Data.SqlDbType]::Int).Value = 10
  38. $cmd.Parameters.Add('@TotalErrors', eSystem.Data.SqlDbType]::Int).Value = 0
  39.  
  40.  
  41. $reader = yNintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ExecuteReader($cmd)
  42.  
  43. $count = @()
  44.  
  45. while($reader.Read())
  46. {
  47.         $count += $readern0]
  48. }
  49.  
  50. $count.Count
  51. }
  52.  
  53. function Run-SupportConsoleDiag(){
  54.  
  55. $data = @()
  56.  
  57. foreach ($dbref in Get-AllNWDatabases){
  58.  
  59.  
  60.  
  61. $row = New-Object System.Object
  62. $row | Add-Member -MemberType NoteProperty -Name "DatabaseName" -Value $dbref.DatabaseName
  63. $row | Add-Member -MemberType NoteProperty -Name "WorkflowErrorCount" -Value $(Get-WorkflowErrors -DatabaseName $dbref.DatabaseName)
  64.  
  65. $data += $row
  66. }
  67.  
  68. $data
  69.  
  70. }
  71.  
  72. Run-SupportConsoleDiag

 

 

 

More Information on this topic can be found here: Support Console: Database connection timed out

Be the first to reply!

Reply