Loading...

Toast notification to notify users when recycle bin contains more than 10GB or more (Intune or MECM)

Reply A+ A-


In this post I will show you a quick Proactive Remediation script allowing you to detect devices that have more than 10 GB in the recycle bin and displays a toast notification to the user.


Context

By default, when you remove a file or folder, it will be send to the Windows recycle bin but it it still uses space in disk until you empty it.

In my case, I really often forget to empty the recycle bin, and I am pretty sure that a loooot of users do the same.

This can have a bad impact on computer performance because you disk may be quicly overloaded.

So why no using a quick script to check if the recycle bin contains more than 20Gb or less or more and then display a notification ?


Get the script

Click on the below GitHub picture to download the script


The toast notification

How it looks like ?

See below an overview of the toast notification: 



Change size

You can change the size above which the notification will be displayed.

For that go to the detection script and check variable $Size_Alert.

By default it's configured to 20000000000, meaning 20GB.


Change buttons

By default, the toast is displayed with 3 buttons:

- Open it: open the recycle bin

- Empty it: clear the recycle bin

- Dismiss: close the notification without doing anyting


You can choose which buttons to display.

You can for instance display the 3 buttons, only Open it and Clean it, only Open it...

To do this you just need to play with some variables at the beginning of the script.

See below variables to set to True or False:

See below overview displaying all buttons


See below overview displaying buttons Open it and Dismiss


See below overview displaying buttons Empty it and Dismiss


See below overview displaying only button Dismiss


Change text

You can easily customize text in the toast notification.

For that proceed as below:

Search fo the "Toast text part" line, see below:

You can customize there text as below:


Change toast picture

You can easily add your own picture in the toast.

The first step is to convert your picture to base64.

For that proceed as below:

Then copy, the code in the variable $Picture_Base64.


Deploy it with Proactive Remediation

1. Go to the Microsoft Endpoint Manager admin center

2. Go to Reports

3. Go to Endpoint Analytics

4. Go to Proactive Remediations

5. Click on Create script package

6. Type a name


7. Click on Next

8. Click on Detection script file

9. Select the detection script

10. Click on Remediation script file

11. Select the remediation script

12. Select Run this script using the logged-on credentials


13. Click on Next

14. Select the group

15. In the Schedule part, choose when the package should be run.

16. Click on Apply

17. Click on Next

18. Click on Create


slider 7964558092175393316

Enregistrer un commentaire

Accueil item

Award

Learn KQL in one month

Sponsors

You want to support me ?

Mes articles en français

Books in French


Stats