Powershell script to enable the IIS Administrative and Operational logging

Introduction

The sample powershell script will help us in enabling the IIS Administrative and Operational logging

Running the Sample

Step1: Open the PSIISAdminOpsLogging.ps1 in Administrator mode from the Powershell ISE.
Step2: Then execute the powershell script from Powershell ISE

Using the Code

The following code snippet is the sample of Script that serves the above requirement

Creating an object of IIS Configuration and Administrative event logging  

PowerShell
Edit|Remove
New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $adminLog 
New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $operationLog

More Information

The following article will give information about Enabling IIS admin and operational logging:
https://blogs.msdn.microsoft.com/webtopics/2010/03/19/iis-7-5-how-to-enable-iis-configuration-auditing/

Microsoft All-In-One Script Framework is an automation script sample library for IT Professionals. The key value that All-In-One Script Framework is trying to deliver is Scenario-Focused Script Samples driven by IT Pros' real-world pains and needs. The team is monitoring all TechNet forums, IT Pros' support calls to Microsoft, and script requests submitted to TechNet Script Repository. We collect frequently asked IT scenarios, and create script samples to automate the tasks and save some time for IT Pros. The team of All-In-One Script Framework sincerely hope that these customer-driven automation script samples can help our IT community in this script-centric move.