How to manage Microsoft Defender Antivirus using PowerShell in Windows 10?

مایکروسافت پارتنر درگاه Surface Connect: کاربردها و اینکه آیا به آن نیاز دارید؟ April 2026
Surface Connect Port: Uses and Do You Need It?
June 15, 2025
مایکروسافت پارتنر چگونه مشخصات کامل حافظه رایانه (سرعت، اندازه، نوع، شماره قطعه، فرم فاکتور) را در ویندوز 10 دریافت کنیم April 2026
How to get full computer memory specifications (speed, size, type, part number, form factor) in Windows 10
June 21, 2025

How to manage Microsoft Defender Antivirus using PowerShell in Windows 10?

You can adjust settings and almost every aspect of the antivirus. Microsoft Defender Manage using PowerShell commands and in this guide I'll help you get started.

On Windows 10, antivirus Microsoft Defender Part of the application Windows Security It protects your system from unwanted viruses, ransomware, spyware, rootkits, and many other malware and hackers. It's even one of our top picks for antivirus.

Although you can easily perform everyday security tasks through the app Windows Security control, but you can also use commands PowerShell Use to manage your anti-malware solution, which is useful in many scenarios. For example, when you want to customize an option that is not available through the graphical interface, such as scheduling a quick or full scan or updating virus signatures. You need to create scripts to perform some tasks. Microsoft Defender Also, using commands instead of a graphical interface can speed up the configuration process, especially when you need to apply the same settings to multiple computers.

 

How to check Microsoft Defender status

 

To check the current status Microsoft Defender by using PowerShell, follow the steps below:

  • Start menu Open.
  • Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  • Type the following command to check the status Microsoft Defender Antivirus and press Enter:
    Get-MpComputerStatus
  • Setting AntivirusEnabled Check that the value True to make sure the security solution is running.

In this step-by-step guide, we'll show you how to get started with antivirus management. Microsoft Defender Using commands PowerShell I will explain.

 

مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

In addition to checking whether the antivirus is running or not, the command output also displays other important information such as the engine version and product version, real-time protection status, the last time it was updated, and more.

 

How to check for Microsoft Defender updates

 

To use PowerShell To update Microsoft Defender Antivirus , follow the steps below:

  1. Start menu Open.
  2. Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  3. Type the following command to Microsoft Defender Antivirus Update and press Enter:
    Update-MpSignature
 
مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

Once the steps are complete, if new updates are available, they will be automatically downloaded and installed on your device.

 

How to perform a quick virus scan with Microsoft Defender

 

To perform a quick scan using PowerShell, follow the steps below:

  1. Start menu Open.
  2. Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  3. Type the following command to start a quick virus scan and press Enter:
    Start-MpScan -ScanType QuickScan
 
مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

After completing the steps, Microsoft Defender Antivirus It will perform a quick virus scan on your device.

 

How to perform a full virus scan with Microsoft Defender

 

To perform a full scan using the commands in Windows 10, follow the steps below:

  1. Start menu Open.
  2. Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  3. Type the following command to start a full virus scan and press Enter:
    Start-MpScan -ScanType FullScan
 
مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

Once the steps are complete, Windows 10 Antivirus will scan the entire system for malware and malicious code.

 

How to perform a custom virus scan with Microsoft Defender

 

To set up a custom scan using PowerShell, follow the steps below:

  1. Start menu Open.
  2. Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  3. Type the following command to perform a custom scan Microsoft Defender Antivirus Done and press Enter:
    Start-MpScan -ScanType CustomScan -ScanPath PATH\TO\FOLDER-FILES

In this command, make sure you update the path correctly to the folder you want to scan. For example, this command will scan the “Downloads” folder:
Start-MpScan -ScanType CustomScan -ScanPath "C:\Users\user\Downloads

 

مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

After completing the steps, Microsoft Defender It will only scan for viruses in the location you specify.

 

How to perform an offline virus scan with Microsoft Defender

 

After completing the steps, Microsoft Defender It will only scan for viruses in the location you specify.

How to perform an offline virus scan with Microsoft Defender

Microsoft Defender Antivirus It also provides an offline scanning option, which is useful in cases where unwanted malware infects the device and the antivirus cannot remove it when Windows 10 is fully loaded.

Quick Tip: Save any work you may have open before proceeding, as this command will immediately reboot the device to perform an offline scan.

To start an offline scan, follow these steps:

  1. Start menu Open.
  2. Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  3. Type the following command to start an offline virus scan and press Enter:
    Start-MpWDOScan

After the process is complete, the device will automatically restart. The device will enter the recovery environment and perform a full scan to remove viruses that were not detected during normal Windows 10 operation. After the scan, the device will restart again, and then you can view the scan report in Windows Security > Virus & Threat Protection > Protection History See.

 

How to remove active threats in Microsoft Defender

 

To remove all active threats from your computer, follow these steps:

  1. Start menu Open.
  2. Phrase PowerShell Search for , right-click on the top result and select Run as administrator select
  3. Type the following command to scan for active threats using Microsoft Defender Delete and press Enter:
    Remove-MpThreat

 

مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

Once the steps are complete, the anti-malware feature will remove any active threats from your computer. While this command is interesting, it will only work for threats that your antivirus has not already mitigated.

 

How to change Microsoft Defender settings

 

 

مایکروسافت پارتنر چگونه آنتی‌ویروس Microsoft Defender را با استفاده از PowerShell در ویندوز 10 مدیریت کنیم؟ April 2026

 

After completing the steps, you will be able to understand all the settings you can configure with the built-in antivirus.

 

As a result, managing Microsoft Defender Antivirus using PowerShell in Windows 10 It is an efficient and flexible method for users and system administrators. By mastering PowerShell commands and scripts, you can easily check the security status of your system, change settings, and make necessary optimizations. This tool allows you to manage the security of your systems automatically and remotely and prevent cyber threats. By continuing to develop your PowerShell skills, you can maximize your productivity and security in today's digital world.

 

 

en_GBEnglish