Jump to content


anyweb

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

Recommended Posts

Introduction

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.

reset-windows.gif

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.

Tooltips

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

tooltips.png

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

psexec.png

and below I'm launching the script using SYSTEM context

testing the script.png

Don't forget to configure the to/from address and API key here

api key.png

After resetting, the email is sent and this is what it looks like

windows was reset on.png

Download the files

Ok now you've seen the changes, give it a try ! follow the instructions in the previous part and use the updated script here.

Note: you must be logged on to windows-noob.com to download scripts.

reset-windows_ver_003.zip

 

cheers !

niall

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.

Guest
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.

Loading...


×
×
  • 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.