I need to run a export-mailbox weekly to move the mail from the inbox to an archive folder under the same email account. I would like to create a sub folder for each weekly archive to be the date of the archive run
Export-Mailbox -Identity journal -includefolder '\inbox' -TargetMailbox journal -TargetFolder archive\date
I know I can add the -startdate $((get-date).adddays(-7)) -enddate $(get-date) to pull the data by the date
I would like to name the folders of archive by the name of the date.