Jump to content


Gathering logs and sending an email when you need to reset Windows Autopilot - part 3

Recommended Posts


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.

I've now updated the code quite a few times with the following changes.

  • modified text boxes to 'read' better
  • modified warnings to make it clear when a device might become unbootable
  • added visual clues (traffic lights) to show which method is recommended
  • changed the default method to Wipe
  • added code to check for missing WindowsRE environment and to attempt to repair it if missing
  • modified reg keys so you can reinstall from the company portal if you click cancel
  • bug fixes

Well that's it, so let's take a look at some of the changes.

When it launches, by default the Wipe method is highlighted with a Green traffic light. This is the recommended Windows reset option for most users.


the Refresh option is shown as follows...


and the Secure Wipe option is shown with a red stop light, this visual clue should hopefully get the users to think before continuing with this method...


If the user hovers over a method they'll get tooltips about what it does


And if they decide to continue they'll get more info about the possible choice made (it's a dynamic message)



If the user proceeds with the reset then the Windows Autopilot (and other related logs) are gathered, zipped up and emailed to your inbox, and other actions can be taken within the reset-windows.ps1 script, such as a payload of your choice (hint: remove device from an azure ad group) before finally resetting Windows using the method you specified.

that's it ! please test this new release and give me your feedback

for instructions to set this up, use the new scripts in this blog post but see how here.


You can download the new solution here:




Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.