Frage

I am trying to run a batch file which runs powershell script (Export-mailbox -identity admin -pstFolderPath \srv02\d$\test)

I have been running the export-mailbox command manually to export 20 mailboxes. I would like to make this process as a script so I can run it everyday to make a backup of all mailboxes with pst files.

Does anyone know how to do this?

War es hilfreich?

Lösung

You can list the mailboxes you want to export into a csv file then import the csv file in the batch to export each mail item. Something like...

$Mailboxes=Import-Csv \\srv02\d$\test\mailboxes.csv
$Mailboxes | ForEach-Object{Export-mailbox -identity admin -pstFolderPath \srv02\d$\test}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top