Timeout exceeded during script execution

Timeout exceeded during script execution

This error occurs when some powershell scripts take longer time than the mentioned timeout value when Exchange server monitor is added in Powershell mode.

1. Try polling the monitor and check if the error continues to retain. 
2. Open powershell in administrator mode in the AppManager installed machine.
3. Go to <AppManager-Home>\working\conf\application\scripts\powershell
4. Run the below commands by replacing hostname, username and password with that of the reported Exchange server to find the time taken for the execution of each script.
            Measure-Command{.\EX_CommonCounters.ps1 'hostname' 'username' 'password'}
If Mailbox role (2010 and above):
            Measure-Command{.\E201X_MBX_Tables.ps1 'hostname' 'username' 'password'}
If Mailbox role (2007):
            Measure-Command{.\E2007_MBX_Tables.ps1 'hostname' 'username' 'password'}
If Admin -> Performance Polling -> Optimize data collection -> Monitor Type as Exchange Server and Data collection enabled for Top Mailboxes by Size, Inactive Mailbox Users and Exchange Queues
            Measure-Command{.\EX_Mailboxes.ps1 'hostname' 'username' 'password' 'TopMailboxes,InactiveMailboxes,ExchangeQueues'}
For Version 2013 and above :
            Measure-Command{.\E2013_ComponentStates.ps1 'hostname' 'username' 'password'}
Choose the script file from below list based on version and role and run this command
            Measure-Command{.\<scriptname> 'hostname' 'username' 'password'}
  1. Exchange 2019 Mailbox Role - E2019_MBX_Counters.ps1
  2. Exchange 2019 Edge Transport Role - E2016_EDGE_Counters.ps1
  3. Exchange 2016 Mailbox Role - E2016_MBX_Counters.ps1
  4. Exchange 2016 Edge Transport Role - E2016_EDGE_Counters.ps1
  5. Exchange 2013 Mailbox Role - E2013_MBX_Counters.ps1
  6. Exchange 2013 Client Access Role - E2013_CAS_Counters.ps1
  7. Exchange 2013 Edge Role - E2013_EDGE_Counters.ps1
  8. Exchange 2010 Mailbox Role - E2010_MBX_Counters.ps1
  9. Exchange 2010 Client Access Role - E2010_CAS_Counters.ps1
  10. Exchange 2010 Edge/Hub Transport Role - E2010_TRANSPORT_Counters.ps1
  11. Exchange 2010 Unified Messaging Role - E2010_UM_Counters.ps1
  12. Exchange 2007 Mailbox Role - E2007_MBX_Counters.ps1
  13. Exchange 2007 Client Access Role - E2007_CAS_Counters.ps1
  14. Exchange 2007 Hub Transport Role - E2007_HUB_Counters.ps1
  15. Exchange 2007 Edge Transport Role - E2007_EDGE_Counters.ps1
  16. Exchange 2007 Unified Messaging Role - E2007_UM_Counters.ps1
  17. Exchange 2003 and Below - E2003_Counters.ps1
5. Check the time taken for the script execution and based on that set the Timeout and Polling interval in the Edit monitor page and poll the monitor.