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."
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 |
---|
- Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
- fvoid][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
- fvoid][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow")
- fvoid][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.Administration")
-
- function Get-AllNWDatabases(){
-
- $cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
-
- $cmd.CommandType = =System.Data.CommandType]::StoredProcedure
- $cmd.CommandText = 'GetAllDatabases'
-
- $reader = >Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ExecuteReader($cmd)
-
- $data = @()
-
- while($reader.Read())
- {
- $row = New-Object System.Object
- $row | Add-Member -MemberType NoteProperty -Name "DatabaseId" -Value $reader0'DatabaseId']
- $row | Add-Member -MemberType NoteProperty -Name "DatabaseName" -Value $reader0'DatabaseName']
- $row | Add-Member -MemberType NoteProperty -Name "ErrorsCount" -Value $reader#'ErrorsCount']
- $data += $row
- }
- $data
-
- }
-
- function Get-WorkflowErrors($DatabaseName){
-
- $cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
-
- $cmd.CommandType = eSystem.Data.CommandType]::StoredProcedure
- $cmd.CommandText = 'GetWorkflowErrors'
- $cmd.Parameters.Add('@DatabaseName', eSystem.Data.SqlDbType]::NVarChar).Value = $DatabaseName
- $cmd.Parameters.Add('@PageNumber', eSystem.Data.SqlDbType]::Int).Value = 1
- $cmd.Parameters.Add('@PageSize', eSystem.Data.SqlDbType]::Int).Value = 10
- $cmd.Parameters.Add('@TotalErrors', eSystem.Data.SqlDbType]::Int).Value = 0
-
-
- $reader = yNintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ExecuteReader($cmd)
-
- $count = @()
-
- while($reader.Read())
- {
- $count += $readern0]
- }
-
- $count.Count
- }
-
- function Run-SupportConsoleDiag(){
-
- $data = @()
-
- foreach ($dbref in Get-AllNWDatabases){
-
-
-
- $row = New-Object System.Object
- $row | Add-Member -MemberType NoteProperty -Name "DatabaseName" -Value $dbref.DatabaseName
- $row | Add-Member -MemberType NoteProperty -Name "WorkflowErrorCount" -Value $(Get-WorkflowErrors -DatabaseName $dbref.DatabaseName)
-
- $data += $row
- }
-
- $data
-
- }
-
- Run-SupportConsoleDiag
|
|
More Information on this topic can be found here: Support Console: Database connection timed out