Afla cum poti sterge un e-mail trimis catre toti membrii din Microsoft Office365: Exchange Online

Configurare noua (How To)

Situatie

In cazul in care aveti nevoie, puteti sterge cu usurinta orice e-mail trimis catre destinatarii care au conturi de Exchange Online (Microsoft Office365) folosind sintaxa de powershell. Cerinte software:

– Windows 8 sau Windows 8.1, Windows Server 2012 sau Windows Server 2012 R2 (x64)
– Windows 7 Service Pack 1 (SP1)*, Windows Server 2008 R2 SP1* (x64)

* Microsoft .NET Framework 4.5 sau 4.5.1 si Windows Management Framework 3.0 sau 4.0

si instalarea urmatoarelor module:
– Microsoft Online Service Sign-in Assistant for IT Professionals;
– Windows Azure Active Directory Module for Windows PowerShell (64biti).

Solutie

Pasi de urmat

De pe calculatorul dvs. deschideti Windows PowerShell (run as administrator) si rulati sintaxa:

$UserCredential = Get-Credential

Confirmati credentialele pentru contul de Admin Exchange Online -> OK.

powershell-credential

Pentru conectare la Exchange Online rulati:

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

urmata de sintaxa:

Import-PSSession $Session


exchange-online-connect

Windows PowerShell trebuie sa fie configurat astfel incat sa accepte scripturi semnate pentru Skype – Business Online, Exchange Online si Compliance Center. Sintaxa de powershell pe care trebuie sa o rulati dupa conectarea la Exchange Online este: Set-ExecutionPolicy RemoteSigned

set-executionpolicy-remotesigned

Atunci cand doriti sa stergeti acelasi e-mail pentru toti utilizatorii de Exchange este necesar sa cunoasteti subiectul mesajului trimis. In cazul de fata: ‘Subject: “iulie august 2015.xlsx”‘. Rulati sintaxa:

Get-Mailbox | Search-Mailbox -SearchQuery ‘Subject: “iulie august 2015.xlsx”‘ -TargetMailbox “Discovery Search Mailbox” -TargetFolder “AllMailboxes-Election” -LogLevel Full -DeleteContent

delete-e-mails-from-exchange-online

Asteptati pana cand procesul de cautare va returna un rezultat, apoi confirmati stergerea e-mailurilor din toate conturile apasand tasta A sau puteti folosi celelalte optiuni (in functie de caz):

[Y] – “Yes” respectiv [N] – “No” (se aplica pentru o singura identitate);
[A] – “Yes to All” respectiv [L] – “No to All” (se aplica pentru toate identitatile);

 

In final este nevoie sa deconectati sesiunea remote din powershell.

Sintaxa in acest caz este : Remove-PSSession $Session

exchange-disconnect-ps

Tip solutie

Permanent

Impact colateral

Va recomand sa folositi cu prudenta sintaxa de stergere.

Voteaza

(18 din 51 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?