FR36: Active Directory GPO backup issues (error: Backup-GPO : The specified path, file name, or both are too long. The fully qualified file name must be less than 260)

Article ID: 84962

Article Type: Technical Reference

Last Modified:

Customers who update to Feature Release 36 may encounter errors with Active Directory (AD) backups. The error message states that the path is too long.

-This issue did not occur before updating to Feature Release 36, as GPO was not backed up. -The error message reads: "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."

Example errors from logging:

$cvJob = Invoke-Command -ComputerName localhost -Credential $credential -ScriptBlock { Start-Sleep -seconds 0; Backup-GPO -Guid 'E15469CF-30C5-474A-A76B-D8698A3D3C69' -Path 'C:\Program Files\Commvault\ContentStore\iDataAgent\JobResults\CV_JobResults\2\0\1799098\GPODir\E15469CF-30C5-474A-A76B-D8698A3D3C69' -Domain 'NA.AD.ETS.AlixPartners.com' -Server 'eVS0SF1NADC1'  | Out-File -Encoding ASCII -FilePath 'C:\Program Files\Commvault\ContentStore\iDataAgent\JobResults\CV_JobResults\2\0\1799098\GPODir\29f944f0-e94d-4017-ad6c-614968b0fff8_powershelloutput.txt'; if ($? -eq $False) { Write $Error[0] | Out-File -Encoding ASCII -FilePath 'C:\Program Files\Commvault\ContentStore\iDataAgent\JobResults\CV_JobResults\2\0\1799098\GPODir\29f944f0-e94d-4017-ad6c-614968b0fff8_powershelloutput.txt'; throw $Error[0]};} -AsJob; wait-job $cvJob -timeout 900; if ($cvJob.state -like 'Failed') {Exit 1;}; if ($cvJob.state -like 'Running') {stop-job $cvJob; Exit 2;}"],
 error: Backup-GPO : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
============================


Enhancements were made to backup GPOs

In SP 36, enhancements were made to the backup of Group Policy Objects (GPOs). Occasionally, the GPO backup path may exceed Microsoft’s file path length limitation of 260 characters.

Solution for Long Paths

Microsoft provides a solution for handling long paths by enabling a specific registry setting. Follow these steps to enable long paths:

  1. Open the Registry Editor.
  2. Navigate to the following path

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled

  1. Create a new DWORD (32-bit) value named LongPathsEnabled.
  2. Set the value to 1.

For detailed instructions, refer to the Microsoft documentation on enabling long paths in Windows - Enable long paths in Windows

GPO Backup Path Length

GPOs may have a folder or file structure that exceeds 260 characters when backing up to the Commvault Job Results folder. Implementing the registry setting described above should ensure that GPO backups with long paths are successful. Example:

 C:\Program Files\Commvault\ContentStore2\iDataAgent\JobResults\CV_JobResults\2\0\12233550\GPODir\ F9FED42D-1FCA-4EBA-B4F3-22B2C3219D86\{A569AFA1-15E7-4EBB-A9584D4099FA81D9}\DomainSysvol\GPO\Machine\Scripts\Startup\Backup_CheckAndDeployCitrixReceiverPerMachineStartupScript_COMPO.bat


Alternative Solution

In case users do not want to implement Microsoft’s solution, Commvault offers an additional setting to dump the GPOs to a defined short path on the local machine:

To change the backup path of GPO to a shorter path, create an entity-level additional setting as follows:

Additional setting:

Name: ShorterPathForGPODump
Category: Active Directory
Type: String
Value: C:\GPODump   (This is the target directory on the local AD server)


 Enable long paths in Windows 

1 Commvault Way, Tinton Falls, NJ 07724 Sitemap | Legal Notices | Trademarks | Privacy Policy
Copyright © Commvault | All Rights Reserved.