Solved

Powershell Exchange Script

Posted on 2014-02-28
4
285 Views
Last Modified: 2014-02-28
Hi Experts,

I have the following code:

Export-Mailbox –Identity "Mail" -PSTFolderPath C:\Mail\mail.user -Confirm:$false

Open in new window


I would like to add the creation date to the pst file that is created. Is this possible? Any help will be appreciated.

Regards,

introlux
0
Comment
Question by:introlux
  • 3
4 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
ID: 39895146
Should be able to do this.

$Today= Get-Date -format M-d-yyyy
Export-Mailbox –Identity "Mail" -PSTFolderPath C:\Mail\mail.user-$today -Confirm:$false
0
 

Author Comment

by:introlux
ID: 39895185
That will work but what if it is run the same day? this will overwrite the file. How can we timestamp this too?
0
 

Author Comment

by:introlux
ID: 39895204
$now = [datetime]::now.ToString('dd-MM-yyyy-HHMM')
0
 

Author Closing Comment

by:introlux
ID: 39895207
Thanks!
0

Featured Post

Are your end users making ugly email signatures?

Have you left it up to your end users to create their own email signatures? Are they forgetting to add the company logo or using garish font colors? Take control and ensure all users have the same email signature.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
A brief introduction to what I consider to be the best editor for PowerShell.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now