Exchange 2013: Error - Exception has been thrown by the target of an invocation.

Problem

Exchange 2013: Error - Exception has been thrown by the target of an invocation.

Error when you try to install Microsoft Exchange Server 2013 Cumulative Update 2. In an Exchange Setup log you can find the following:

[08.15.2013 11:51:07.0535] [0] [ERROR] Exception has been thrown by the target of an invocation.
[08.15.2013 11:51:07.0535] [0] [ERROR] The type initializer for 'Microsoft.Exchange.Data.Directory.Globals' threw an exception.
[08.15.2013 11:51:07.0535] [0] [ERROR] The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (Exception from HRESULT: 0x80070422)

Resolution

That’s right, Exchange Setup for some reason disables all MS Exchange services which result an error in case you launch setup again. Start Exchange services and try to run setup again.
Make sure as well Windows Management Instrumentation and IP Helper services are started and have startup type Automatic.