To recover some of the Windows shortcuts that were deleted on Friday morning, Microsoft released a PowerShell script and an Advanced Hunting Query (AHQ) script.
Microsoft released a Microsoft Defender signature update on January 13th, 2018, that added a new rule to the Attack Surface Reduction condition known as “Block Win32 API calls from Office macro” in the Configuration Manager console and “Win32 imports from Office macro code” in the Intune console.
This rule blocks malware from using VBA macros to call Win32 APIs.
However, in the updated MS Defender rules, there was a bug that resulted in false positives showing up, removing shortcuts from the desktop, the Start menu, and the Windows Taskbar.
This disruptive rule triggered widespread disarray in corporate environments, with users being unable to access their programs and Windows administrators rushing to reestablish the shortcuts for their own apps.
Microsoft later reverted the change in the new signature update 1.381.2164.0, but warned admins that it could take a few hours for the latest signatures to propagate to all environments.
Script released to recreate deleted shortcuts
On Saturday morning, Microsoft recently introduced advanced queries for finding affected shortcuts and a script to re-enable shortcuts for a number of commonly deleted applications.
Microsoft confirmed a process consumers can use to cause the start menu links to return for a significant subset of the applications that had been deleted.
These commands, now remedied, have been compiled into the PowerShell script provided here to allow administrators to take restoration tasks in their environment.
To analyze the effect this bug will have on your business operations, you can use Microsoft Defender search queries to retrieve information from Friday relating to the faulty rule.
You can use this PowerShell script shared on GitHub if you wish to check the value of the HKLM\ SOFTWARE \Microsoft\ Windows\ CurrentVersion\ App Paths\registry key, which is used by thirty-three different software programs.
If a program is installed, the script checks to see whether a corresponding shortcut exists in the Start Menu and, if not, creates it.
The list of applications whose shortcuts will be recreated are: