![Outlook 365 delete emails in specific folder](https://knopkazmeya.com/18.png)
![outlook 365 delete emails in specific folder outlook 365 delete emails in specific folder](https://cdn.extendoffice.com/images/stories/doc-outlook/ad-ttw/Attachments/delete-attachments-in-multiple-emails-1.png)
4 Stores deleted items in the mailbox owner's folder. Change the value data in the Edit DWORD Value dialog box to one of the following values: 8 Stores deleted items in your folder. Type DelegateWastebasketStyle, and then press Enter. Point to New, and then select DWORD Value. Traversal = :: Deep $findFolderResults = $MailboxRoot. Right-click the General folder in the path that's defined in step 3. ImpersonatedUserId = New-Object .ImpersonatedUserId ` ( :: SMTPAddress, $Mailbox ) #Connect to the Inbox $MailboxRootid = new-object .FolderId ` ( :: MsgFolderRoot, $Mailbox ) $MailboxRoot = :: Bind( $service, $MailboxRootid ) #Getting Folders in the Mailbox # you can change to folder view if there are more them 100 folder in the mailbox $FolderList = new-object .FolderView(100) $FolderList. Credentials = New-Object .WebCredentials -ArgumentList ` $AccountWithImpersonationRights, $password $service. #Usage Example: #Empty Junk Email Folder From user Mailbox #>.\EmptyFolder-Ews.ps1 -Mailbox -folder "Junk Email" -admin -pass "adminpass" #Empty Junk Email Folder as well as folders under Junk Email From user Mailbox #>.\EmptyFolder-Ews.ps1 -Mailbox -folder "Junk Email" -DeleteSubFolders $true -admin -pass "adminpass" #= param ( $Mailbox $folder $DeleteSubFolders $admin $pass ) #Impersonate Admin Account details $AccountWithImpersonationRights = $admin $password = $pass #folder which you wants to empty from user mailbox $FolderToEmpty = $folder #EWS url for your orgnization $uri = "" #define EWS Dll file Path $dllpath = "C:\Program Files\Microsoft\Exchange\Web Services\2.0\" Import-Module $dllpath #- # Set Exchange Version $ExchangeVersion = :: Exchange2010_SP2 $service = New-Object .ExchangeService( $ExchangeVersion ) $service. #= #Author = Sunil Chauhan #Email= #Blogs= #= # this Script can be useful to Quickly Empty a specific Folder in user mailbox # can also delete subfolder under a specific folder.
![Outlook 365 delete emails in specific folder](https://knopkazmeya.com/18.png)