Friday, September 11, 2015

Prevent Users From Deleting Emails From A Shared Mailbox

To let users only review emails but unable to edit/remove emails in shared mailbox, you can setup the shared mailbox by following the steps below,

1 - Remove the user from the group which has been granted the full access permission on the shared mailbox,
2 - Open the shared mailbox in Outlook with another account who has full access permission on the shared mailbox,
3 - Right click the shared mailbox, click Data File Properties, in Permission tab, click add to add a user, and choose reviewer from the Permission level drop down list,
4 - Right click the inbox folder of the shared mailbox, click Properties, in Permission tab, click add to add the same user, and choose reviewer from the Permission level drop down list,



Then this user can open the shared mailbox in Outlook as usual but only able to view the emails in inbox and unable to edit/remove emails.

Delete a spam or specific Message from all mailboxes on Exchange 2010

The following two method that you can use to delete a spam or specific message from all Mailbox on your exchange server 2010:

Method #1:
Run the following PSCMD for each exchange server that you have, to delete the message with the following criteria (Subject / From | Received / Date).

Get-Mailbox -Database “mailbox server” | Search-Mailbox  -targetmailbox backupmailbox -targetfolder “DeletedMSG” -SearchQuery {Subject:"the subject of the target message" AND From:"Sender email address" AND Sent:"02/12/2014 12:45:00"} -loglevel full -DeleteContent

Method #2:
Run the following two small PS scripts to track and delete the messages.


Tracking:
-----------------
$x = Get-ExchangeServer | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog  -messagesubject "security"  -eventid “deliver” -Start "02/12/2014 12:45:00 PM" -end "02/12/2014 12:47:00 PM" -resultsize "unlimited"
$y = $x|select timestamp, sender, @{l="Recipients";e={$_.Recipients -join " "}}, messagesubject, serverhostname, messageid |Sort-Object -Property timestamp
$y|export-csv c:\temp\tracking.csv

Deletion :
------------
$x=get-content c:\OrderInvoice.txt
foreach ($y in $x)
{
$result=$null
$count=$null
$result=Search-Mailbox -identity $y -SearchQuery 'subject:"OrderInvoice" AND Received:23/11/2014' -DeleteContent -force -resultsize unlimited
$count=$result.ResultItemsCount
add-content C:\result.txt "$count`n"
}