Backing up PST files to OneDrive: need a way of getting the local OneDrive folder to release the space automatically

Mandy Shaw 0 Reputation points
2024-05-21T15:26:30.2533333+00:00

I'm backing up PST files to OneDrive (but definitely never opening them in Outlook there).

This works fine except that I don't seem to be able to get OneDrive to release the local space automatically, which is a problem given I am doing all this on a 128GB Surface.

I run a powershell script as follows:

get-childitem . -Force -File -Recurse |

where Attributes -eq 'Archive, ReparsePoint' |

foreach {

attrib.exe $_.fullname +U -P

}

to tell OneDrive to release the local space for my backups in general, and it works perfectly with everything except the PST files.

(BTW I do the backups using robocopy which rightly refuses to copy the PST file if it's open in Outlook.)

Any ideas what might be going wrong here? Or is there perhaps a non-powershell automated mechanism I can use?

I initially posted this in the Outlook category in Community but was told to come here instead.

Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | OneDrive | For business | Windows
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.