PowerShell script to get the reason why a Unified Messaging worker process recycled

If you are the administrator of an Exchange Unified Messaging server, you might want to know why the UM worker process is recycling and how often. The following one line PowerShell script will print out all the reasons why the process recycled:

 

 get-eventlog application | where { ($_.EventId -ge 1049 -and $_.EventId -le 1055) -or $_.EventId -eq 1092 } | ft -wrap

If you run this command, you will get an output like so:

 

 

Index Time          Type Source                EventID Message                                                             
----- ----          ---- ------                ------- -------                                                             
56821 Mar 12 20:35  Info MSExchange Unified M     1055 The Unified Messaging Worker Process was terminated because the confi
    9                    essaging                      gured maximum lifetime was exceeded.                                
56773 Mar 12 20:05  Info MSExchange Unified M     1000 The Unified Messaging Worker Process was started successfully on port
    4                    essaging                       "5065".                                                            
56772 Mar 12 20:04  Info MSExchange Unified M     1051 The Microsoft Exchange Unified Messaging service has created a new UM
    5                    essaging                       WorkerProcess because the working set (589 MB) has exceeded the conf
                                                       igured maximum: 500 MB"                                             
52146 Mar 11 03:55  Info MSExchange Unified M     1055 The Unified Messaging Worker Process was terminated because the confi
    1                    essaging                      gured maximum lifetime was exceeded.                                
52099 Mar 11 03:25  Info MSExchange Unified M     1000 The Unified Messaging Worker Process was started successfully on port
    2                    essaging                       "5067".                                                            
52098 Mar 11 03:24  Info MSExchange Unified M     1051 The Microsoft Exchange Unified Messaging service has created a new UM
    1                    essaging                       WorkerProcess because the working set (777 MB) has exceeded the conf
                                                       igured maximum: 500 MB"                                             
49992 Mar 10 02:55  Info MSExchange Unified M     1055 The Unified Messaging Worker Process was terminated because the confi
    1                    essaging                      gured maximum lifetime was exceeded.                                
49948 Mar 10 02:25  Info MSExchange Unified M     1000 The Unified Messaging Worker Process was started successfully on port
    6                    essaging                       "5065".                                                            
49947 Mar 10 02:24  Info MSExchange Unified M     1051 The Microsoft Exchange Unified Messaging service has created a new UM
    7                    essaging                       WorkerProcess because the working set (644 MB) has exceeded the conf
                                                       igured maximum: 500 MB"