Andy Andy
asked on
Delete email from user mailbox
Hello Team,
We have exchange 2013,
by mistake some confidential email has been sent to user, fromExchange administrator, please suggest the command to delete the specific email with subject line and mailbox name we know..
from powershell
Thanks,
Andy
We have exchange 2013,
by mistake some confidential email has been sent to user, fromExchange administrator, please suggest the command to delete the specific email with subject line and mailbox name we know..
from powershell
Thanks,
Andy
Search-Mailbox -Identity "username or alias" -SearchQuery 'Subject:" Your query "' -DeleteContent
ref link:https://www.petri.com/delete-email-from-microsoft-exchange-user-mailboxes-using-powershell
ref link:https://www.petri.com/delete-email-from-microsoft-exchange-user-mailboxes-using-powershell
Or You can just EAC select user, go to mailbox delegation and assign full rights for yourself
Then add his mailbox in your Outlook account properties, Advance Tab.
Find email and Delete it WITH SHIFT BUTTON.
Then disconnect mailbox and remove delegation
Then add his mailbox in your Outlook account properties, Advance Tab.
Find email and Delete it WITH SHIFT BUTTON.
Then disconnect mailbox and remove delegation
he said He want to ......from powershell
ASKER
i am getting error :
The target mailbox or .pst file path is required.
The target mailbox or .pst file path is required.
ASKER
sorry this is exact error
WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a
search query is specified. To return more than 10000 results, use the
New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the
Exchange Administration Center.
WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a
search query is specified. To return more than 10000 results, use the
New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the
Exchange Administration Center.
Try to do without shell, you'll have control what you doing and you'll not delete anything by accident
ASKER
No we cant take access,, as per security compliance
You shouldn't have to do an overall search, you stated the email was sent to one user, correct? Input the user's email address in the command
Search-Mailbox -Identity johnDoe@yourdomain.com -SearchQuery 'Subject:" Your query "' -DeleteContent
Search-Mailbox -Identity johnDoe@yourdomain.com -SearchQuery 'Subject:" Your query "' -DeleteContent
ASKER
still same error
WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a
search query is specified. To return more than 10000 results, use the
New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the
Exchange Administration Center.
we have exchange 2013
WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a
search query is specified. To return more than 10000 results, use the
New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the
Exchange Administration Center.
we have exchange 2013
If not mistaken, the message is a warning when you run search-mailbox,
https://social.technet.microsoft.com/Forums/exchange/en-US/f5ac72c8-aed5-4fce-9764-5063c0a37a9e/delete-greater-than-10000-messages?forum=exchangesvradmin
https://social.technet.microsoft.com/Forums/exchange/en-US/f5ac72c8-aed5-4fce-9764-5063c0a37a9e/delete-greater-than-10000-messages?forum=exchangesvradmin
Hi Andy,
The 'WARNING: The Search-Mailbox cmdlet returns [...]" text is not an error. It is just a notification letting you know about the maximum number of search results.
If you are getting any other errors, verify that you are meeting all requirements mentioned in this article:
http://www.codetwo.com/admins-blog/how-to-delete-email-from-mailboxes-on-exchange-2016-2013-2010-online/?sts=6552
The correct output after running the Search-Mailbox command with the -DeleteContent switch should be something like this:
Hope this helps,
CodeTwo
The 'WARNING: The Search-Mailbox cmdlet returns [...]" text is not an error. It is just a notification letting you know about the maximum number of search results.
If you are getting any other errors, verify that you are meeting all requirements mentioned in this article:
http://www.codetwo.com/admins-blog/how-to-delete-email-from-mailboxes-on-exchange-2016-2013-2010-online/?sts=6552
The correct output after running the Search-Mailbox command with the -DeleteContent switch should be something like this:
Hope this helps,
CodeTwo
ASKER
still it did not help, Emmanuel Adebayo, suriyaehnop and code two.. could you please help to give exact command
Could post the screenshot of the error
ASKER
here the error below
WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a
search query is specified. To return more than 10000 results, use the
New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the
Exchange Administration Center.
The operation couldn't be performed because object
'andy@abc.com' couldn't be found on 'chl.ent.abc.com'.
+ CategoryInfo : InvalidArgument: (0:Int32) [Search-Mailbox], Man
agementObjectNotFoundExcep tion
+ FullyQualifiedErrorId : [Server=CHLTE307,RequestId =06799d63- a789-469c- 92
4a-56eee61837e3,TimeStamp= 12/15/2016 9:56:47 AM] [FailureCategory=Cmdlet-M
anagementObjectNotFoundExc eption] 3EE42C4B,Microsoft.Exchang e.Manageme nt.T
asks.SearchMailbox
+ PSComputerName : exchangecasarray.abc.com
WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a
search query is specified. To return more than 10000 results, use the
New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the
Exchange Administration Center.
The operation couldn't be performed because object
'andy@abc.com' couldn't be found on 'chl.ent.abc.com'.
+ CategoryInfo : InvalidArgument: (0:Int32) [Search-Mailbox], Man
agementObjectNotFoundExcep
+ FullyQualifiedErrorId : [Server=CHLTE307,RequestId
4a-56eee61837e3,TimeStamp=
anagementObjectNotFoundExc
asks.SearchMailbox
+ PSComputerName : exchangecasarray.abc.com
Hi Andy,
Have you tried providing just the alias of the mailbox you want to search? e.g.:
Have you tried providing just the alias of the mailbox you want to search? e.g.:
Search-Mailbox -Identity m.smith -SearchQuery '<your query>' -DeleteContent
ASKER
yes, after trying this, i am getting that error
"Andy@abc.com could't found"?, what search query you want to perform? "Andy@abc.com" is a mailbox? Try a simple search-mailbox for which item you do confirm exist in the mailbox, just to make sure your query is correct and execute successfully
ASKER
yes that mailbox is exist and i can see that is working too.. it is my own account
Can you use other "identity" instead of smtp address e.g. Alias, legacyexchangedn
https://technet.microsoft.com/en-us/library/dd298173(v=exchg.160).aspx
https://technet.microsoft.com/en-us/library/dd298173(v=exchg.160).aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
I know this question is closed, but I wanted to add some of my real-world usage and experience.
I use this to remove mail from all mailboxes if something that needs to be retracted is gone from all users mailboxes.
I call it Seek & Destroy
If you want to target a mailbox you know what to do since this was in the above comments.
I use this to remove mail from all mailboxes if something that needs to be retracted is gone from all users mailboxes.
I call it Seek & Destroy
Add-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.E2010
Import-Module ActiveDirectory
Get-Mailbox | Search-Mailbox -SearchQuery {Subject:"Your Conference Calling Card Information:" AND received:11/12/2015} -DeleteContent -Force
If you want to target a mailbox you know what to do since this was in the above comments.
Search-Mailbox -Identity "username or alias" -SearchQuery 'Subject:" Your query "' -DeleteContent
Regards