MSEndpointMgr

Citrix XenApp & Office 2016 – AutoCorrect Entries Disappearing

I recently came across an issue with Office 2016 and Citrix XenApp where by a user’s Word autocorrect entries would be wiped intermittently during a live session. After a quick search I found that Microsoft’s product support have identified this as a known issue and have provided a work around ; https://answers.microsoft.com/en-us/office/forum/office_2016-word/normal-template-wiped-again/a96dba06-68f7-40e8-a1a2-55ddef1bcca7?auth=1.

The issue here is that the work around requires users to access their AppData folder and modify files based on date, not something you would want Citrix user sessions to have to do.

So I came up with a work around for my environment using PowerShell.

Step1. Backup AutoCorrect Entries

For this process I use the following PS script running as part of a log off script process in a GPO. The backup process will only replace previous backups whereby the file size exceeds that of the previous backup (as users tend to keep adding autocorrect entries and thus the file size increases);

Step 2. Restoring AutoCorrect Entries

The following PowerShell script can be run automatically via a log on PS script in a GPO or in my instance I opted to publish the script via XenApp so that users can restore data when an issue arises;

<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.99
Created on: 01/03/2016 12:32
Created by: Maurice.Daly
Organization:
Filename:
===========================================================================
.DESCRIPTION
Word Autotext Backup Script
#>

$AutoTextLocation = $env:APPDATA + "\Microsoft\Templates"
$BackupLocation = [environment]::GetFolderPath("MyDocuments") + "\AutoTextBackup"

If ((Test-Path -Path $BackupLocation) -eq $false)
{
$AutoCorrectFiles = Get-ChildItem -Path $AutoTextLocation | Where-Object { $_.Name -like "Normal*.*" }
New-Item $BackupLocation -Type dir
Copy-Item -Path $AutoCorrectFiles.FullName -Destination $BackupLocation
}else{
$AutoCorrectFiles = Get-ChildItem -Path $AutoTextLocation | Where-Object { $_.Name -like "Normal*.*" }
foreach ($File in $AutoCorrectFiles)
{
if ((Get-Item -Path $File.FullName).Length -gt (Get-ChildItem -Path ($BackupLocation + "\" + $File.Name)).Length)
{
Copy-Item -Path $File.FullName -Destination $BackupLocation -Verbose
}
}
}

The PowerShell scripts assume that you using re-mapped My Documents as a backup location and that you want some form of interactivity during the restore process, i.e to advise them that Word and Outlook will be terminated and whether or not the restore process was successful. Obviously you can chop/change this as required but it does the trick.

Hopefully this helps some of you with this issue.

Maurice Daly

Maurice has been working in the IT industry for the past 20 years and currently working in the role of Senior Cloud Architect with CloudWay. With a focus on OS deployment through SCCM/MDT, group policies, active directory, virtualisation and office 365, Maurice has been a Windows Server MCSE since 2008 and was awarded Enterprise Mobility MVP in March 2017. Most recently his focus has been on automation of deployment tasks, creating and sharing PowerShell scripts and other content to help others streamline their deployment processes.

Add comment

Sponsors

Categories

MSEndpointMgr.com use cookies to ensure that we give you the best experience on our website.