Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

delete only pst Files from Exchange Users

$
0
0

Hello, i'm trying to create a backup script for my exchange server. I want to export all mailboxes with these script. I have two folders with read/write permissions for the Exchange Trusted Subsystem.

\\nas001\backup\vmsrv008\pst

and

\\nas001\backup\vmsrv008\pst-old

I have the following Powershell command to move the items from pst to pst-old folder. It works very good.

Move-Item $ExportShare\*.pst $ExportShareOld

But what I do first is to delete the files in the pst-old directory. My problem is now how to delete only the *.pst files where also is a mailbox in Exchange Server. I don't want to delete any *.pst files where no user exists in my Exchange Server.^

Any ideas?

Thank you very much....

Christoph


Viewing all articles
Browse latest Browse all 6937

Trending Articles