Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$old_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ext-thumbnail_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_wordproof_timestamp is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Windows Defender: come gestire la scansione del sistema con PowerShell | IlSoftware.it

Windows Defender: come gestire la scansione del sistema con PowerShell

PowerShell offre gli strumenti accessibili da riga di comando per gestire la scansione del sistema con Windows Defender in Windows 10.

Utilizzando PowerShell è possibile configurare molteplici aspetti del sistema operativo. Abbiamo già visto, ad esempio, come comprimere file e cartelle con PowerShell in formato Zip senza usare altri strumenti. Windows Defender, l’antimalware di sistema che è stato da qualche tempo rinominato in Microsoft Defender, supporta anch’esso comandi inviati tramite PowerShell.

Ciò significa che è possibile gestire l’antivirus Windows senza usare l’interfaccia ma agendo esclusivamente da riga di comando. Ciò è molto utile perché è possibile ridurre i tempi e servirsi di script per ottimizzare la gestione di Windows Defender, sia in Windows 10 che in Windows 11. Usando cmdlet PowerShell, gli amministratori possono programmare una scansione automatica del sistema o richiedere l’aggiornamento delle firme antivirus.

Verificare lo stato di Windows Defender con PowerShell

Per mettere alla prova le funzionalità dei vari comandi PowerShell utili per la gestione di Windows Defender, è sufficiente premere la combinazione di tasti Windows+X quindi scegliere Windows PowerShell (amministratore) in Windows 10 oppure Terminale (Admin) in Windows 11.

Scrivendo Get-MpComputerStatus quindi verificando che accanto alla voce AntivirusEnabled compaia True, ci si può accertare dello stato di Windows Defender (antimalware attivato e funzionante). Il comando restituisce molte altre informazioni sulla configurazione di Windows Defender e del PC in uso.

Con uno script come quello che segue si può estrarre lo stato del servizio di Windows Defender, dell’antivirus e del modulo antispyware:

$status = Get-MpComputerStatus

$serviceStatus = $status.AMServiceEnabled

$antivirusStatus = $status.AntivirusEnabled

$antispywareStatus = $status.AntispywareEnabled

Write-Host "Lo stato del servizio antimalware è: $serviceStatus"

Write-Host "Lo stato dell'antivirus è: $antivirusStatus"

Write-Host "Lo stato dell'antispyware è: $antispywareStatus"

Nulla vieta di selezionare tutti i vari comandi, copiarli negli appunti di Windows (CTRL+C) quindi incollarli nella finestra di PowerShell, ad esempio premendo il tasto destro del mouse.

Come controllare la disponibilità degli aggiornamenti

Il comando Update-MpSignature consente di aggiornare il database delle firme antivirus, ove necessario. Il download e l’installazione degli aggiornamenti per l’antimalware Microsoft avvengono automaticamente.

Il modulo di aggiornamento provvede a verificare la presenza di nuove definizioni sia per quanto riguarda l’antivirus vero e proprio che l’antispyware.

Avviare una scansione del sistema

Limitandosi a utilizzare sempre la finestra di PowerShell, è possibile avviare una scansione veloce del sistema semplicemente usando il comando seguente:

Start-MpScan -ScanType QuickScan

Per avviare una scansione completa basta invece usare quanto segue:

Start-MpScan -ScanType FullScan

Da PowerShell si può richiedere anche l’avvio di una scansione personalizzata specificando la cartella o i percorsi da controllare:

Start-MpScan -ScanType CustomScan -ScanPath "C:\Users\NOME_UTENTE\Downloads"

Nell’esempio, si chiede a Windows Defender di analizzare il contenuto della cartella di sistema Download senza estendere la scansione antimalware al resto del sistema.

Nel caso in cui il sistema in uso non fosse collegato alla rete Internet o comunque una minaccia già presente in Windows non permettesse di avviare correttamente la macchina, si può ripiegare sull’effettuazione di una scansione offline con Windows Defender. Nell’articolo abbiamo presentato i vari passaggi da seguire.

Eseguire una scansione offline

Anche dal prompt di PowerShell, digitando Start-MpWDOScan, è possibile richiedere il riavvio automatico del sistema e l’effettuazione di una scansione in modalità offline.

In questo modo Windows 10 o Windows 11 è automaticamente avviato nella modalità di emergenza e da qui eseguita la scansione antimalware. Al successivo riavvio di Windows, per verificare l’esito della scansione in modalità offline, basta digitare Sicurezza di Windows nel menu Start, fare clic su Protezione da virus e minacce nella colonna di sinistra quindi scegliere Cronologia della protezione.

Rimuovere le minacce presenti sul sistema

Per rimuovere tutte le minacce attive eventualmente presenti sul sistema in uso, si può digitare Remove-MpThreat al prompt di PowerShell. Si tratta di un comando utile che però sortisce effetto solo per le minacce precedentemente riconosciute e trattate da Windows Defender.

Programmare una scansione del sistema

PowerShell aiuta anche a programmare una scansione veloce del sistema: basta scrivere Set-MpPreference -ScanScheduleQuickScanTime 07:00:00 avendo cura di specificare l’orario preferito.

Usando la sintassi seguente, invece, si può programmare una scansione completa (2) da effettuarsi la domenica (1, con 2 la scansione avverrebbe di lunedì e così via; indicando 0 verrà effettuata ogni giorno) alle ore 7:

Set-MpPreference -ScanParameters 2
Set-MpPreference -RemediationScheduleDay 1
Set-MpPreference -RemediationScheduleTime 07:00:00

Per ottimizzare il funzionamento di Windows Defender, suggeriamo di utilizzare l’applicazione gratuita DefenderUI. Si tratta di un programma a costo zero che consente di accedere a un ampio ventaglio di funzionalità che di norma non vengono esposte dall’interfaccia dell’antimalware integrato in Windows 10 e Windows 11.

Ti consigliamo anche

Link copiato negli appunti