Using WMI to Modify Settings at runtime

来源:互联网 发布:淘宝买书哪家店铺好 编辑:程序博客网 时间:2024/06/15 14:40

http://msdn.microsoft.com/en-us/library/ms735120.aspx

http://msdn.microsoft.com/en-us/library/aa702726.aspx

Using WMI to Modify Settings (Windows Management Instrumentation)

You can use WMI to change configuration settings at runtime (by enabling the wmiProviderEnabled attribute in the configuration, as demonstrated in the previously configuration example). For example,you can use WMI within the CIM Studio to change the trace source levels from Warning to Information at runtime. You should be aware that the performance cost of live debugging in this way can be very high. For more information about using WMI, see the Using Windows Management Instrumentation for Diagnostics topic.

 <system.serviceModel>  <diagnostics wmiProviderEnabled="true">      <messageLogging            logEntireMessage="true"            logMalformedMessages="true"           logMessagesAtServiceLevel="true"            logMessagesAtTransportLevel="true"           maxMessagesToLog="3000"        />  </diagnostics> </system.serviceModel>