The script is available for download from https://gallery.technet.microsoft.com//How-to-restore-user-after-8caa8a52. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This script sample is used to restore user after deleting AD user in DirSync environment in Office 365
This script sample is used to restore a synced user in Office 365 which was deleted in local AD, after the user is restored in local or a new user is created by using the same alias.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery