When path is too long

Last weekend I run into an issue, where due to missing disk space availability my server run into back pressure.

Exchange has a feature, which will move the current mail queue file and the respective log files to another folder. This happens when transport service detects an issue with the current queue and is called QueueDatabaseRecoveryAction.

Symptom

But i don’t want to dive into the issue with crashing transport service. This needs some additional investigations.

The problem is that transport service tending to create with this behavior a scenario, where you won’t be able to delete the old files and folders anymore as the path is too long:

Solution

There is no way of deleting the folder structure with the explorer or even with PowerShell. The only way to get rid of this is our good old friend Robocopy:

I used the nirroring functionality and let the tool remove all the items underneath the Messaging.old-* folder with the following steps:

  • create an empty folder (as source)
  • open an elevated PowerShell
  • run the command:
robocopy <empty source path> <path to Messaging.old-* folder> /mir

After a few minutes I reclaimed free space and Exchange was not anymore in back pressure

Conclusion

Nothing special, but hopefully handy for someone.

Sometimes we have to remember the good “old” tools…

3 thoughts on “When path is too long

  1. Hey Ingo with server 2016 and newer you can access long path with powershell you have to enable the feature via gpo or via regedit..
    Set-ItemProperty -Path HKLM:\System\ControlSet001\Control\FileSystem -Name LongPathsEnabled -Value 1

    after this powershell can address longpath … the explorer can’t regarding the manifest.xml
    https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/

    Oryou can use the ntfssecurity ps module which comes with get-childitem2 which can address longpath as well …

    Cheers

    Christoph

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s