Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Powershell Exchange Script

Posted on 2014-02-28
4
Medium Priority
?
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 2000 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

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

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

A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In this video we show how to create an Address List 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 Organization >> Ad…
how to add IIS SMTP to handle application/Scanner relays into office 365.

721 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