title: Exchange anagement Shell catch enable-mailbox error
body: <p>I have script that creates user accounts and establishes an e-mail address for those accounts. All 'create-commands' are surrounded by a try/catch block to catch errors and add a message to the output log. This works fine... except for the enable-mailbox command</p>
  
  <pre><code>try { 
      Enable-Maibox (.. parameters ...) 
  }
  catch {
      $errorsEncountered = $true
      Write-Output "Error establishing e-mail address for $($UserData.username)"
  }
  </code></pre>
  
  <p>when the enable-mailbox command fails... the catch-part is skipped. Why is this? And how can I fix this?</p>