When trying to backup a GPO using the GP management console (choosing the GP to backup, right click, hitting backup, and choosing a target directory "c:\ADB"), the backup fails.

In the Application eventvwr I can see the error is:

Backup of GPO failed. Error [The filename or extension is too long.]

But the detials are :

 Details -
     Source GPO:
          DisplayName: Default Domain Policy
          Domain: accad.int

         Directory: \\share\
         Instance : 
         Comment  : 

Which doesn't help me...

How can I get to the file that fails?

How can I turn on logging that can show me how to do it?

Is there any command line method to run this backup?

After running:

PS C:\Users\administrator> import-module grouppolicy
PS C:\Users\administrator> Backup-Gpo "Default Domain Policy" -Path c:\ADBackup -Comment "Backup-08-22-14"
Backup-GPO : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 c
haracters, and the directory name must be less than 248 characters.
At line:1 char:11
+ Backup-Gpo <<<<  "Default Domain Policy" -Path c:\ADBackup -Comment "Backup-08-22-14"
    + CategoryInfo          : NotSpecified: (:) [Backup-GPO], PathTooLongException
    + FullyQualifiedErrorId : System.IO.PathTooLongException,Microsoft.GroupPolicy.Commands.BackupGpoCommand

I still don't know where to start looking for the specific path / directory that is problematic...


Since I couldn't find any small app that searches files with path longer than... - I wrote one.
You can find it at : https://sourceforge.net/projects/pathlength/

It's a very small application that allows you to search the conditions that the AD (or generally apps) require.
The only thing to remember - run it on the DC that hosts the policies files (since in my case - the share name was shorter, but the c:...\SYSVOL was longer.

hope it will help.


You may have to troubleshoot a little further. Are you able to backup other GPOs? Did you try using an alternative admin account? Can you create a test one and back that up? If you can, then I would check permission on the previous GPO where you are receiving the error.

There is a powershell command you can use:

Backup-Gpo -Name MYGPO -Path C:\GpoBackup -Comment "Backup-08-21-14"

  • Hey, I left the office already, I'll try it first thing in the morning and let you know. I have not tried neither - a different user nor powershell script.. didn't even know it would affect. I'll let you know tomorrow :) thanks!! – evenro Aug 21 '14 at 19:58
  • I ran the backup that way - and although got a bit more information (path is longer than X chars) - it still doesn't direct me to the specific path that I need to shorten.. I also think that the paths in the backup are relative to the root, so it would not be the NTFS path that is too long.. so I really wanna find the file from a backup log, and not from an OS search. Any ideas? – evenro Aug 22 '14 at 12:50
  • Have you seen my update? still stuck with it... – evenro Sep 16 '14 at 19:49
  • One other way you can backup is simply copying Policies folder. You can write a simple script to automate this process or do it manually. So basically in Windows Explorer, open: \\local.domain\SYSVOL\local.domain\Policies folder and copy it somewhere. In order to troubleshoot your particular issue, did you try installing RSAT tools on a Windows 7/8 machine and make a gpo backup using the gui? – anonymous coward Sep 18 '14 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.