schedule auto archive of journal mailbox with exchange powershell
Hi I want to setup a schedule on the 20th of each month to archive all email from my journal account called 'archive' to a network location. Easy enough. I want all email in the mailbox archived. Again easy. However, I wan to creat a powershell script to add the date to the name of the .pst. This is the script i have created: ------------------------------------------------------------ $date = ( get-date ).ToString('yyyyMMdd') $pst = New-Item -type file "$date-JOURNAL.PST" Export-Mailbox -Identity archive -PSTFolderPath \\fileserver1\c$\Archive\$pst ------------------------------------------------------------- What I'm not sure about is the -type being 'file'. Is there a type object called PST? Paul
March 3rd, 2011 7:33am

You don't need to use the new-item name since you can specify the name of the PST with export-mailbox $date = ( get-date ).ToString('yyyyMMdd') $pst = "$date-JOURNAL.PST" Export-Mailbox -Identity archive -PSTFolderPath \\fileserver1\c$\Archive\$pst if you do a help export-mailbox -examples you can see an example of where the specify a PST filenameExchange & Powershell Geek View my MCP Certifications
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2011 9:47am

Thanks Aaron
March 4th, 2011 6:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics