The EFTDeleteExpiredUsers.wsf script in the SAT - Delete Expired Users Event Rule deletes the wrong folder


THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • EFT Server, v6.3.x through 6.4.9

SYMPTOM

The EFTDeleteExpiredUsers.wsf script in the SAT - Delete Expired Users Event Rule deletes the wrong folder.

RESOLUTION

Update the EFTDeleteExpiredUsers.wsf script, as described below.

MORE INFORMATION

Upgrading to EFT 6.4.10 prevents this issue from occurring. For any legacy accounts created incorrectly before moving to the 6.4.10 (or newer) build, there is potential for the EFTDeleteExpiredUsers.wsf script, which runs on a schedule, to delete the wrong folder, which could include all users' folders for the EFTAdhoc Settings Template or, potentially, all folders under the Site root.

To avoid deleting incorrect folders, a few lines can be added to the script that resides under <EFT Server Installation Directory>\GlobalSCAPE\EFT Server Enterprise\Scripts.

Create a backup copy of EFTDeleteExpiredUsers.wsf and then add the lines described below to the original:

This below section of code starts on line 154 of the Script, add the highlighted lines:

---START CODE SNIPPIT---

if Err.number <> 0 then
Call Log("WARNING: An error occurred while getting the user's home folder Physical Path. [" & Err.number & "] " & Err.Description)
missingHomefolder = true
End if

'Check to see if home folder matches user name ie home folder is set to site root or settings template root.  If not Prevent homefolder deletion
if InStr(sUserHomeFolder,arUsers(j)) < 1 then
missingHomeFolder = true
End If
                                                                                                
on error goto 0
                                                                                                
'ensure the folder exists
If oFSO.FolderExists(sUserHomeFolder) = true and not missingHomefolder Then

---END CODE SNIPPIT---

Once this change is made to the EFTDeleteExpiredUsers.wsf, save the file.

Instead of editing the script, you can download the attached ZIP file, which contains the updated script. Save a copy of your existing script instead of overwriting it, in case you have customized it in some way.

Refer to "SAT Event Rules" in the EFT Server help documentation for more information.