[-SiteName] <String> [[-VirtualPath] <String>]. [-Uri] <Uri>, -ApplicationObject <ApplicationInfo>, or -Root
Operational scope of the cmdlet
-MonitoringLevel
{<Custom> | <EndToEndMonitoring> | <ErrorsOnly> | <HealthMonitoring> | <Off> | <Troubleshooting>}
-Confirm
Option to confirm action or not
-ConnectionStringName <String>
Connection string to access specific monitoring database
Here are two examples of the Set-ASAppMonitoring cmdlet. The first example sets monitoring settings in the root Web.config file. The second one sets settings at the application level for the MyWorkflowApp application. Both of the scopes show the default HealthMonitoring level as the configured monitoring level.
Example 1
Example 2
You can also write .NET code by using the Windows Powershell SDK that invokes AppFabric cmdlets. Your .NET project must reference the Windows PowerShell automation assembly located at C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0. Use this version even though it points to Version 1 (v1.0). Also, if you will be running your image on an x64 platform, make sure you compile your project against "x64". To do this you must manually create this target configuration in your Visual Studio project.
Here is some code you can use to programmatically set the monitoring level by using the Set-ASAppMonitoring cmdlet. Note the ps.Command.Clear(); line – without it the call to Invoke for Set-ASAppMonitoring won’t work.