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.
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.^
Thank you very much....