Gathering logs and sending an email when you need to reset Windows Autopilot – part 2


In a previous blog post I explained how you could use the SendGrid resource in Azure to send emails, and with a PowerShell script create an Intune app to give end users additional options when resetting their Windows Autopilot provisioned pc. This app would gather the Autopilot diagnostic logs (and other relevant logs) and send an email to your support inbox prior to resetting the pc. This was a very popular post so I updated the code to add some new features and to give more information to the end user.

So let’s take a look at the changes.

New reset option

In the new version (version .003) there’s an additional reset option called Refresh, it’s based on the doWipePersistUserData option here and this allows user account and data to be retained during the reset.

new ui.png

In addition, I’ve added approximate estimations of how long each reset will take (I might adjust these later on with better estimations), this gives the end user a good idea of which option might be best for them.


I’ve added tooltips throughout the tool so if you hover the mouse over an option you’ll get details about what it offers.


You can customize the content of the tooltips in this section of the reset-windows.ps1 PowerShell script.

tooltips in powershell.png

Updated messages

I’ve modified the messages to make them clearer to the end user. Below is one example.

modified messages.png

Check for Power

The script now checks if a power source is connected, and prompts the end user to connect power if not. This check will only occur if the computer is not a virtual machine.

connect to power.png

Testing the script

To test the script, you can use psexec to launch a cmd prompt in SYSTEM context. After doing that, you can launch the reset-windows.ps1 PowerShell script to see how it works after your changes.

psexec /i /s cmd.exe

You can read the rest of this blog post over at here.

This entry was posted in AzureAD, Intune, sendgrid, Windows 10. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.