Powershell Query Office 365 messages

Source: Internet
Author: User
Tags local time

Beans today reset the mail configuration of a financial software, you need to inquire about the successful delivery. Sign in to Office 365-admin-exchange-mail flow and set the conditions to query


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/76/7E/wKioL1ZU-CTgigYuAADrHJMQ0K4224.png "style=" float: none; "title=" 1.PNG "alt=" Wkiol1zu-ctgigyuaadrhjmq0k4224.png "/>


Then the problem arises, and the system displays the time in UTC, not the time of my location.

According to Microsoft's explanation, this is not a solution, so as a cloud server, Office365 is not aware of the local time of the user's computer.

https://support.microsoft.com/en-us/kb/2800633



650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/76/7E/wKioL1ZU-CWD_VRqAABWEWu-tYI884.png "style=" float: none; "title=" 2.PNG "alt=" Wkiol1zu-cwd_vrqaabwewu-tyi884.png "/>


UTC time looks too awkward, the beans think it is still used PowerShell to get good, you can also re-customize the field.

Here is the corresponding script:


#加载模块 $cred = get-credential "[email protected]" Import-module Msonlineset-executionpolicy Remotesignedconnect-msolservice-credential $cred # sign-in $Session = New-pssession-configurationname Microsoft.exchange -connectionuri https://outlook.office365.com/powershell/-credential $Cred-authentication Basic- Allowredirectionimport-pssession $session # Set the time period for the search and the sender $dateend = get-date $dateStart = $dateEnd. AddHours ( -1) $sender = "[Email protected]" #自定义时间, convert time zone get-messagetrace-startdate $dateStart-enddate $dateEnd-senderaddress $sender | Select-object @{name= ' time '; E={[system.timezone]::currenttimezone.tolocaltime ($_.received)}}, SenderAddress, RecipientAddress, Subject, Status, Toip, FROMIP, Size, MessageID, Messagetraceid | Out-gridview


As a result, you can see that the time has changed to cost time.


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/76/7F/wKiom1ZU98nS_sJyAAAzZzox1xI782.png "style=" float: none; "title=" 3.PNG "alt=" Wkiom1zu98ns_sjyaaazzzox1xi782.png "/>


This article is from the "Mapo Tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1716585

Powershell Query Office 365 messages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.