Defender File Scan Count

Handian Sudianto 6,096 Reputation points
2023-09-06T07:11:07.3533333+00:00

Hello,

Can we get count file scanned by defender using powershell?

Microsoft Security Microsoft Defender Microsoft Defender for Cloud
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. Givary-MSFT 35,621 Reputation points Microsoft Employee Moderator
    2023-09-14T07:03:07.39+00:00

    @Handian Sudianto Apologies for the delayed response, from the above conversation I see you your are looking for PowerShell command which can provide files scanned information.

    Researched on the PowerShell cmdlets available for Windows Defender - https://sid-500.com/2023/05/30/administering-windows-defender-with-powershell/

    https://learn.microsoft.com/en-us/powershell/module/defender/?view=windowsserver2022-ps

    Though we can perform scan from the PowerShell, however it doesnt provide the output results in the PowerShell screen, it can viewed via GUI like you mentioned above.

    Also, its not possible get this information via event viewer as well, reviewed the events as well - https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/troubleshoot-microsoft-defender-antivirus?view=o365-worldwide

    Any specific reason why you are looking for this information via PowerShell.

    Reference: https://answers.microsoft.com/en-us/windows/forum/all/windows-defender-reporting-different-number-of/dd02cdff-0384-4aa1-ba3d-ec9b0d1461eb

    Let me know if you have any further questions, feel free to post back.

    Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Limitless Technology 44,746 Reputation points
    2023-09-06T12:34:59.1366667+00:00

    Hello,

    Thank you for your question and reaching out. I can understand you are having issues related to Counts

    Us the power shell command

    (Get-WinEvent -LogName 'Microsoft-Windows-Windows Defender/Operational' | Where-Object { $_.Id -eq 1006 }).Count

    and see it helps.

    Thank you

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  2. Handian Sudianto 6,096 Reputation points
    2023-09-06T14:03:54.77+00:00

    Hello,

    in the GUI we can see files scanned is 34538

    User's image

    but use given PowerShell script showing 0

    User's image

    0 comments No comments

  3. Handian Sudianto 6,096 Reputation points
    2023-09-14T07:15:23.3533333+00:00

    Hello,

    Thanks for your update. Currently i looking the count scan file just for reporting to management to provide evidence that the server is protected by defender and scanning running normally. We will consider to upgrade the 2012 to 2016 soon, so we can monitor scanned file using GUI.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.