It's a safety net to restore the redirected folders at logoff.
If you have a non-persistent / floating VDI pool, the VM gets refreshed anyway. In that case it's not an issue that the restore does not work.
But I've never seen the error before. Is there a condition configured for the ORD Redirected configuration?
I see that this script at logoff processes for 20 seconds, which is pretty long:
2016-12-13 16:33:48.901 [DEBUG] Running pre-export task ('c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -NoLogo -NonInteractive -ep bypass c:\windows\ord-prepgolden\CustomAssociations.ps1') ('CustomAssociation - Export.xml')
Is this for preserving file type associations?
Yes, it is floating linked clones. There are no conditions.
The powersehell is for preserving FTA's. Because of the way Windows 10 protects the FTA's with a unique per computer hash and beacuse we cant use "Dism /Online /Export-DefaultAppAssociations:\\Server\Share\AppAssoc.xml" to export the associations for non administrator users, I devised this poweshell script script to create an xml identical to what DISM does.
Perhaps 20 seconds is long but its worth it to be able to persist these per user instead of forcing them upon everyone. I wonder if the powershell could use some inspection. I posted it here: Roam File and URL associations on Windows 10
I was able to speed up the script considerably by commenting out the following lines and removing the ApplicationName parameter value. Its not needed for the FTA xml to work properly, its included in the XML for readability..
#$ApplicationKey = "HKLM:\SOFTWARE\Classes\" + $ProgID + "\Application" #$ApplicationName = $(Get-ItemProperty $ApplicationKey -name "ApplicationName" -errorAction SilentlyContinue).ApplicationName $OutputData += '" ApplicationName="" />'