Alert when a file is created in Windows/temp in Windows Server 2012r2

Meza, Julio A 1 Reputation point
2020-01-13T17:33:26.043+00:00

Is there a way to get an alert when a file named SQL.log is created in Windows/temp in Windows Server 2012r2?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,843 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Meza, Julio A 1 Reputation point
    2020-01-13T17:36:38.103+00:00

    File SQL.log is randomly created in Windows/temp folder, which start growing and growing. I deleted, but I would like to be alerted as soon it is created to be able to "read" it and prevent the issue in other servers.

    0 comments No comments

  2. Dave Patrick 426K Reputation points MVP
    2020-01-13T17:40:38.59+00:00
    0 comments No comments

  3. Philippe Levesque 5,681 Reputation points MVP
    2020-01-13T20:09:37.307+00:00

    Hi

    You can achieve that with Windows Auditing natively too.

    To activate:

    • Type gpmc.msc, or gpedit.msc.
    • Navigate to “Computer Configuration” ➔ “Windows Settings” ➔ “Security Settings” ➔ “Local Policies” ➔ “Audit Policy”.
    • Double-click “Audit Object Access”
    • Click “Define these policy settings” checkbox. Click “Success” and “Failure”.

    Now, you need to select that auditing to the folder;

    • Open “Windows Explorer”, and navigate to the folder that you want to track.
    • Right-click the folder and select “Properties”, and go to the Security tab
    • Click “Advanced” to access “Advanced Security Settings”. In “Advanced Security Settings” window, navigate to “Auditing” tab.
    • To create a new auditing entry, click “Add”. “Auditing Entry” window will appears
    • Click “Select a Principal” to choose users whose activities you want to track, for your case select Everyone, or if your SQL instance run under a username, please add it there, it will limit the scoop of the auditing.
    • Click Ok, Select “All” in “Type” drop-down menu.
    • Select the permission you want, and click ok 3 time to get out of that windows.

    Now to monitor it, we will check the event viewer.

    Filter on the event id 4616, to see file creation.

    0 comments No comments