Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to delete an entire email through a specific subject in Office365

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Just received a call from a friend, a customer has sent an email that should not be sent to the CEO, using Office365, is there any way to delete the email in the CEO inbox in the background.

The answer is yes, but it requires certain permissions and methods. Here's how to share it with you.

First of all, I use my QQ mailbox to send an email to my Office365 mailbox. I see that the email has been sent in my QQ mailbox.

Office 365 has this email in your inbox.

Then the operation required is to empower the administrator, first of all, the right to discover, this right will not take effect immediately, it takes a while to add it.

Then the next step is to require a mailbox import export permission, where you can create a special group for convenience, add this mailbox import export role to the group and add users to it. Since I created a PST permission group (same mailbox import export permission requirement) when I wrote my blog about bulk import and export PST files, I won't demonstrate it here.

The next step is to connect to Exchange Online Powershell remotely via Windows Powershell. As usual, write ps1 file first and then connect remotely directly in Powershell

The Ps1 file reads as follows:

Set-ExecutionPolicy RemoteSigned

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session -DisableNameChecking

After connecting to Exchange Online remote Powershell, use Search command to query and delete operation, the specific command is as follows:

Search-Mailbox -Identity Username -SearchQuery 'Subject:"XXX"-DeleteContent

This completes the deletion action, you can see that my entire inbox actually has 11 emails with the subject name hello, all deleted.

In fact, this is a relatively high risk, may delete the previous mail, then you can use the received parameter plus a time limit can easily avoid this problem.

Then we went into my mailbox to check the email just sent from QQ mailbox and disappeared

Not even in Outlook.

There is no deleted email, indicating that this problem has been successfully solved.

As I said before, this kind of permission distribution will have alert emails to inform other global administrators in the enterprise, so Office365 administrators should not be lucky to do something they should not do.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report