tag:blogger.com,1999:blog-746726189537118047.post5155830885072141586..comments2023-07-12T15:27:51.375+10:00Comments on Occasional Utility: Everyday Powershell - Part 17 - Using new-mailboxexportrequest with NON-US datesBen Hasletthttp://www.blogger.com/profile/13473217184605706502noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-746726189537118047.post-48466539351765421432019-08-21T22:24:07.986+10:002019-08-21T22:24:07.986+10:00Thanks for the suggestion but it doesn't work ...Thanks for the suggestion but it doesn't work for me... I get the same date conversion errorAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-58277208384925483172019-06-20T19:36:21.648+10:002019-06-20T19:36:21.648+10:00Thanks for your post, it was really helpful.
I too...Thanks for your post, it was really helpful.<br />I took a slightly different approach using a PSSession eventually.<br />Please see my comment on: https://serverfault.com/questions/786851/contentfilter-is-invalid-system-datetime/972213#972213Martijnnoreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-55141057552030310172018-01-12T18:55:27.497+11:002018-01-12T18:55:27.497+11:00Thank you, it was help me.Thank you, it was help me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-56152917007607485042017-03-22T09:05:34.621+11:002017-03-22T09:05:34.621+11:00Thanks for this. It doesn't work as is, but I ...Thanks for this. It doesn't work as is, but I worked it out - wrap everything in a function otherwise Powershell 'forgets' the Culture you just set.<br /><br />Function dostuff {<br />[System.Threading.Thread]::CurrentThread.CurrentCulture = "en-US"<br />$since=(Get-Date).AddDays(-1)<br />echo $since.ToShortDateString()<br />Add-PSSnapin *exchange*<br />New-MailboxExportRequest -Mailbox "scooper" -ContentFilter "(Received -ge '$since')" -FilePath "\\svrbarb50\l$\PSTExport\scooper3.pst" -ExcludeDumpster<br />}<br /><br />PS C:\Users\xcooper> dostuff<br />3/20/2017<br /><br />Name Mailbox Status<br />---- ------- ------<br />MailboxExport4 /Users/Cooper, Steve Queued<br /><br /><br />PS C:\Users\xcooper> Get-MailboxExportRequest -identity scooper\mailboxexport4<br /><br />Name Mailbox Status<br />---- ------- ------<br />MailboxExport4 /Users/Cooper, Steve Completed<br /><br />SteveCoopshttps://www.blogger.com/profile/05159820499858248885noreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-81339662935701439662016-05-20T22:44:34.479+10:002016-05-20T22:44:34.479+10:00Any luck by chance for John querry
Any luck by chance for John querry<br /> Manojhttps://www.blogger.com/profile/11755210494843337080noreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-52528953403390868992015-01-16T03:33:49.619+11:002015-01-16T03:33:49.619+11:00Fabulous script. One thing - I first tried to run...Fabulous script. One thing - I first tried to run it in the Exchange Management Shell and the System Culture did not affect because the cmdlets were already loaded. I needed to run it in Powershell so that it changed the Culture before loading the Exchange Snapins and then it worked like a charm. Thank you for saving me soooo much time.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-8727604971260384592014-07-25T12:56:36.303+10:002014-07-25T12:56:36.303+10:00John,
I that's an interesting question. I'...John,<br /><br />I that's an interesting question. I'll have a poke around and see what I can dig up. First guess is it's just Powershell being "helpful".<br /><br />Let me see what I can come up with and I'll make another post when I get the chance.Ben Hasletthttps://www.blogger.com/profile/13473217184605706502noreply@blogger.comtag:blogger.com,1999:blog-746726189537118047.post-20024550027769141032014-06-28T02:38:32.482+10:002014-06-28T02:38:32.482+10:00Hi Ben
I read this article and thought it an idea...Hi Ben<br /><br />I read this article and thought it an ideal solution as changing the server wide culture is something I'd rather avoid. However, I'm having difficulty getting it to work.<br /><br />The server is 2012, en-GB with Exchange 2013 v15.0 (Build 847.32) running Mailbox and Client Access Roles. Here is the output:<br /><br />PS C:\> [System.Reflection.Assembly]::LoadWithPartialName("System.Threading")<br /><br />GAC Version Location<br />--- ------- --------<br />True v4.0.30319 C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Threading\v4.0_4.0.0.0__b03f5f7f11d50a3a\Sys...<br /><br /><br />PS C:\> [System.Reflection.Assembly]::LoadWithPartialName("System.Globalization")<br /><br />GAC Version Location<br />--- ------- --------<br />True v4.0.30319 C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a...<br /><br /><br />PS C:\> [System.Threading.Thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::CreateSpecificCult<br />ure("en-us")<br />PS C:\> $date = get-date<br />PS C:\> $date<br /><br />27 June 2014 17:30:59<br /><br /><br />PS C:\> $date.ToShortDateString()<br />27/06/2014<br />PS C:\><br /><br />As you can see the date format is still dd/mm/yyyy. Any idea where I'm going wrong?<br /><br />Many Thanks<br /><br />John McAlindenAnonymousnoreply@blogger.com