Test agentless malware scanning for VMs in Microsoft Defender for Cloud
In brief
The page now explains how to create and validate a test file on a Linux VM and adds PowerShell steps for creating a Windows test file that triggers an agentless malware scanning alert.
What Defender admins need to know
Administrators have clearer steps for verifying agentless malware scanning alerts on Linux and Windows VMs.
Summaries are generated from the documentation change itself.
Documentation change
The comparison below shows only the changed extract. Use the full-page view for complete context.
Test agentless malware scanning alerts
Create a test file for Linux
Use the following steps to create a test file on a Linux VM and trigger an agentless malware scanning alert.
Open a terminal window on the VM.
Run the following
command:script to create and validate a test file that contains the antivirus test string:# test string
Create a test file for Windows with a text document
Use the following steps to create a Windows text file that triggers a test alert for agentless malware scanning.
Create a text file on your VM.
Paste the text
$$89-barbados-dublin-damascus-notice-pulled-natural-31$$into the text file. Ensure that there are no extra spaces or lines in the text file.Save the file.
Open the file to validate that it contains the pasted test string.
Save the file.
Open the file to validate that it contains the content from stage 2.
The alert MDC_Test_File malware was detected (Agentless) will appear within 24 hours in the Defender for Cloud Alerts page and in the Defender XDR portal.
Create a test file for Windows with PowerShell
Open PowerShell on your VM.
Execute the following script.
The alert MDC_Test_File malware was detected (Agentless) will appear within 24 hours in the Defender for Cloud Alerts page and in the Defender XDR portal.
Create a test file for Windows with PowerShell
Use the following PowerShell steps to create a Windows test file and generate a malware scanning test alert.
Open PowerShell on your VM.
Execute the following script.
@@ -1,9 +1,10 @@ --- title: Test agentless malware scanning for VMs in Microsoft Defender for Cloud-description: Test agentless malware scanning in Microsoft Defender for Cloud.+description: Create a test alert to verify that agentless malware scanning for VMs is working as expected in Microsoft Defender for Cloud. ms.topic: how-to-ms.date: 02/19/2025+ms.date: 07/03/2026 ai-usage: ai-assisted+ms.custom: msecd-doc-authoring-1013 --- # Test agentless malware scanning alerts@@ -19,9 +20,11 @@ This article describes how to create a test alert to make sure that agentless ma ## Create a test file for Linux +Use the following steps to create a test file on a Linux VM and trigger an agentless malware scanning alert.+ 1. Open a terminal window on the VM. -1. Run the following command:+1. Run the following script to create and validate a test file that contains the antivirus test string: ```bash # test string @@ -51,16 +54,15 @@ The alert `MDC_Test_File malware was detected (Agentless)` will appear within 24 ## Create a test file for Windows with a text document -1. Create a text file on your VM.+Use the following steps to create a Windows text file that triggers a test alert for agentless malware scanning. -1. Paste the text `$$89-barbados-dublin-damascus-notice-pulled-natural-31$$` into the text file.+1. Create a text file on your VM. - > [!IMPORTANT]- > Ensure that there are no extra spaces or lines in the text file.+1. Paste the text `$$89-barbados-dublin-damascus-notice-pulled-natural-31$$` into the text file. Ensure that there are no extra spaces or lines in the text file. 1. Save the file. -1. Open the file to validate that it contains the content from stage 2.+1. Open the file to validate that it contains the pasted test string. The alert `MDC_Test_File malware was detected (Agentless)` will appear within 24 hours in the Defender for Cloud Alerts page and in the Defender XDR portal. @@ -68,6 +70,8 @@ The alert `MDC_Test_File malware was detected (Agentless)` will appear within 24 ## Create a test file for Windows with PowerShell +Use the following PowerShell steps to create a Windows test file and generate a malware scanning test alert.+ 1. Open PowerShell on your VM. 1. Execute the following script. 