Archive for June, 2019

[PS] Write powershell errors to a text file

June 19, 2019 No comments

Method 1: Try, Catch, Finally

Try: Try to execute a command
Catch: Catches any errors, triggers only for Terminating Errors, so you may need to set a ErrorAction -Stop (EA) for errors that are not terminating.
Finally: Runs regardless if a error occurs.

Method 2: Output error directly to error log 

Method 3: Customize a out-file to a error log


Categories: Powershell Tags:

[EXCH] The Cluster service cannot be started. Event ID 1090

June 17, 2019 No comments

  1. Check the Status of Mailbox Servers by running Get-DatabaseAvaliabilityGroup | FL
    1. Inspect servers in stopped and started state
    2. If a mailbox is in a stopped state, you can attempt to stop the individual server by running: Stop-DatabaseAvaliabilityGroup -identity <cluster> -mailboxserver <mailbox server>
  2. Check the status of the  Fail-over Cluster Service Manager
    1. Launch Fail-over Cluster Service Manager > Manage a Cluster > Enter  <cluster>
    2. Expand the <cluster>, review Nodes
    3. If a node is stopped, attempt to ‘Start Cluster Service’
    4. If Cluster Service fails to start, run : Stop-DatabaseAvaliabilityGroup -identity <cluster> -mailboxserver <mailbox server> and perform a Set-DatabaseAvalibilityGroup -identity <cluster>
    5. If the mailbox server fails to be evicted, reboot the server; ensure mailbox databases are dismounted first or maintenance mode is effective.
    6. After the restarting, Perform a force cleanup of the cluster from the failed server.
      1. Log into the failed server, Run Cluster Node “ServerName” /forcecleanup from an elevated command prompt.
  3. Once the cleanup is successful, Attempt to re-add or remove the failed server back into the cluster. You can also try running Start-DatabaseAvailabilityGroup “DAG Name” –MailboxServer “FailedServer” or Stop-DatabaseAvailabilityGroup “DAG Name” –MailboxServer “FailedServer”


Categories: Exchange, Powershell Tags: