Enable Audit Logging

  • To Enable Audit Logging, open Group Policy Editor from the start menu.

Graphical user interface, text, application

Description automatically generated

 

  • Navigate to Audit Object Access as shown below. 

Graphical user interface, text, application, email

Description automatically generated

 

  • Select the attempts that we would need to Audit. It can be either Success or Failure or both, based on the desired outcome. 

Graphical user interface, text, application

Description automatically generated

 

  • Now, we have Audit enabled.

 

Group Policy Update

Next, we would need to update Group Policy. 

  • Open Windows PowerShell or Command Prompt in Admin mode. 
  • Type gpupdate /force and press enter. Wait for the Computer and User policy to update.

 

Graphical user interface, text, application

Description automatically generated

 

Folder Permissions:

Next, we would need to give Permissions to the folder where we want the Audit Logging. 

  • Navigate to the folder properties.
  • Select Security Tab and hit Advanced. 

Graphical user interface, application

Description automatically generated

 

  • Click on Add. 

Graphical user interface, text, application, email

Description automatically generated

 

  • Select the Permissions for which we would need to enable Logging. For example, if we need to Audit any deletion from this folder, select the two options encircled below. 

Graphical user interface, text, application, email

Description automatically generated

 

  • Hit Ok.

 

Event Viewer: 

  • Next, open event viewer and hit Create Custom View to easily filter the desired logging. 

Graphical user interface, text, application, email

Description automatically generated

 

  • Navigate to xml tab and paste the query given below as shown. We would need to edit the path in the below query.
<QueryList>
  <Query Id="0" Path="Security">
    <Select Path="Security">
      *[EventData[Data[@Name='ObjectName'] and (Data='C:\Program Files (x86)\Sliq\test.txt')]]
   </Select>
  </Query>
</QueryList>

Graphical user interface, text, application

Description automatically generated

 

  • Hit Ok and we will have the logging from this location only.