none
StartDagServerMaintenance fails during checkdatabaseredundancy

    Question

  • Hi,

    Environment:

    2 node DAG running Exchange 2010 SP3 RU12

    The command startdagservermaintenance.ps1 fails with the following error message:

     

    Exception setting "lastgreenreportedutc": "cannot convert null to type "system.datetime"."
    at checkdatabaseredundancy.ps1:563 char:2

    + $dbredundancy.lastgreenreportedutc = $null

     + Categoryinfo:   NotSpecified:<:> [], SetValueInvocationException
     + FullyQualifiedErrorId: ExceptionWhenSetting

    I can run the checkdatabaseredundancy script on the server with no issues (lastgreenreportedutc has a current date for all databases)

    The datacenteractivation parameter is set to off

    Any suggestions

    Leif Pedersen

    Wednesday, March 30, 2016 7:47 AM

All replies

  • Hi Leif,

    Welcome to Technet forum.

    What is language of OS and Exchange?

    What is command when you run startdagservermaintenance script?

    By this issue, we suggest you post result which you run checkdatabaseredundancy script to us for troubleshooting, we need to view the entire of result. 

    Please run this command in Exchange PowerShell instead of Windows PowerShell.

    In addition, please restart the cluster service to check if the issue persist.

    Best Regard,

    Jim Xu

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Jim Xu
    TechNet Community Support


    Thursday, March 31, 2016 5:41 AM
    Moderator
  • Hi,

    Language is English for both OS and Exchange and configured as such for my account. Could be configured to Danish time format for the technician that have the issue.

    The command used is just startdagservermaintenance.ps1 and then enter the servername when asked

    Everything is run from the Exchange Management Shell

    Server has been restarted and the issue persists

    The complete output from CheckDatabaseRedundancy.ps1 is:

    DatabaseName            
    : DB02

    LastRedundancyCount      : 0

    CurrentRedundancyCount   : 2

    LastState               
    : Unknown

    CurrentState            
    : Green

    LastStateTransitionUtc   : 4/1/2016 11:24:26 AM

    LastGreenTransitionUtc   : 4/1/2016 11:24:26 AM

    LastRedTransitionUtc     :

    LastGreenReportedUtc     : 4/1/2016 11:24:26 AM

    LastRedReportedUtc       :

    PreviousTotalRedDuration : 00:00:00

    TotalRedDuration         : 00:00:00

    IsTransitioningState     : True

    HasErrorsInHistory       : False

    CurrentErrorMessages     :

    ErrorHistory            
    :<o:p></o:p>

    DatabaseName            
    : DB03

    LastRedundancyCount      : 0

    CurrentRedundancyCount   : 2

    LastState               
    : Unknown

    CurrentState            
    : Green

    LastStateTransitionUtc   : 4/1/2016 11:24:26 AM

    LastGreenTransitionUtc   : 4/1/2016 11:24:26 AM

    LastRedTransitionUtc     :

    LastGreenReportedUtc     : 4/1/2016 11:24:26 AM

    LastRedReportedUtc       :

    PreviousTotalRedDuration : 00:00:00

    TotalRedDuration         : 00:00:00

    IsTransitioningState     : True

    HasErrorsInHistory       : False

    CurrentErrorMessages     :

    ErrorHistory            
    :<o:p></o:p>

    DatabaseName            
    : DB04

    LastRedundancyCount      : 0

    CurrentRedundancyCount   : 2

    LastState               
    : Unknown

    CurrentState            
    : Green

    LastStateTransitionUtc   : 4/1/2016 11:24:26 AM

    LastGreenTransitionUtc   : 4/1/2016 11:24:26 AM

    LastRedTransitionUtc     :

    LastGreenReportedUtc     : 4/1/2016 11:24:26 AM

    LastRedReportedUtc       :

    PreviousTotalRedDuration : 00:00:00

    TotalRedDuration         : 00:00:00

    IsTransitioningState     : True

    HasErrorsInHistory       : False

    CurrentErrorMessages     :

    ErrorHistory            
    :<o:p></o:p>

    DatabaseName            
    : DB01

    LastRedundancyCount      : 0

    CurrentRedundancyCount   : 2

    LastState               
    : Unknown

    CurrentState            
    : Green

    LastStateTransitionUtc   : 4/1/2016 11:24:26 AM

    LastGreenTransitionUtc   : 4/1/2016 11:24:26 AM

    LastRedTransitionUtc     :

    LastGreenReportedUtc     : 4/1/2016 11:24:26 AM

    LastRedReportedUtc       :

    PreviousTotalRedDuration : 00:00:00

    TotalRedDuration         : 00:00:00

    IsTransitioningState     : True

    HasErrorsInHistory       : False

    CurrentErrorMessages     :

    ErrorHistory            
    :<o:p></o:p>


    regards

    Leif Pedersen

    Friday, April 01, 2016 11:37 AM
  • Hi, We are experiencing the same issue on Exchange 2010 SP3 RU13 - run the StartDagServerMaintenance.ps1 script and it returning the following:-

    Exception setting "LastGreenReportedUtc": "Cannot convert null to type "System.DateTime"."
    At C:\Program Files\Microsoft\Exchange Server\V14\Scripts\CheckDatabaseRedundancy.ps1:563 char:2
    +     $dbRedundancy.LastGreenReportedUtc = $null
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
        + FullyQualifiedErrorId : ExceptionWhenSetting

    I can also run the CheckDatabaseRedundancy.ps1 on its own without issue!

    The issue with the StartDagServerMaintenance.ps1 script became evident for us after we installed "Windows Management Framework 4.0" and ".NET 4.5" on the DAG servers (required as they are pre-requisites for updating NetApp Snap Manager for Exchange). According to MS, these framework versions are supported (https://technet.microsoft.com/en-us/library/ff728623(v=exchg.150).aspx) but they must be the cause of this issue for us. 

    I had to run the manual steps to put the DAG in maintenance mode (https://support.microsoft.com/en-us/kb/3058960) but we need to find a solution to the script not working,

    Thanks

    Wednesday, May 04, 2016 2:00 PM
  • Hi,

    Did you have a chance to have a look at the issue (I see that I am not the only one with this problem)

    Hope to hear from you soon

    regards

    Leif Pedersen

    Friday, May 06, 2016 2:14 PM
  • Exact same problem.

    Needed to upgrade to PS 4.0 (also for NetApp).

    Had always opposed upgrading PS because I knew versions 3.0 and 4.0 were not compatible.

    Then I learned that since Exchange 2010 SP3 RU5 they supposedly are (despite mentions of problems running scripts in this discussion as well):

    https://social.technet.microsoft.com/Forums/exchange/en-US/bcde2ca6-cb63-40c1-ab59-db8dcd441775/problem-with-exchange-2010-scripts-after-installing-powershell-40?forum=exchangesvradmin

    Indeed, the matrix does say PS 3 and 4 are compatible... but not for scripts:

    https://technet.microsoft.com/en-us/library/ff728623(v=exchg.150).aspx

    However, as far as I can see, the EMS shortcut is pointing to version 2.0:

    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -version 2.0 -noexit -command ". 'E:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto"

    (Note the -version 2.0 switch)

    Someone in the discussion cited above mentioned something about deleting a folder... but I'm going to have to take a second look before deleting anything.

    So this seems to remain an issue.

    Anyone else have to deal with this?


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

    Wednesday, July 20, 2016 1:00 AM
  • Any suggestions for Leif?

    Thanks!


    Ed Price, Azure Development Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Wednesday, August 31, 2016 4:31 AM
    Owner