SOLVED

Export to PST via Powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-95007%22%20slang%3D%22en-US%22%3EExport%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-95007%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20continually%20expanding%20on%20my%20offboarding%20process%20within%20Orchestrator.%20I%20decided%20to%20add%20the%20export%20of%20the%20email%20so%20that%20all%20that%20has%20to%20be%20done%20is%20go%20to%20the%20Content%20search%20and%20download%20it%20(unless%20someone%20knows%20how%20to%20do%20that%20as%20well...).%20My%20addition%20works%2C%20however%2C%20instead%20of%20creating%20a%20single%20PST%20file%2C%20I%20end%20up%20getting%20the%20actual%20folders%20with%20individual%20email%20in%20message%20file%20format.%20I%20have%20tried%20what%20is%20correct%20per%20everything%20I%20could%20find%20(honestly%2C%20not%20a%20lot%20of%20detail%20on%20the%20subject).%20The%20current%20single%20line%20in%20question%20is%3A%3C%2FP%3E%3CPRE%3ENew-ComplianceSearchAction%20-SearchName%20%24SearchName%20-Export%20-ArchiveFormat%20PerUserPST%20-EnableDedupe%20%24true%20%3C%2FPRE%3E%3CP%3EI%20have%20tried%20different%20values%20for%20-ArchiveFormat%20including%20leaving%20it%20completely%20off%20since%20a%20single%20pst%20per%20user%20is%20supposed%20to%20be%20the%20default.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20will%20include%20the%20entire%20part%20of%20the%20script%20responsible%20for%20the%20full%20function%20in%20case%20it%20is%20supposed%20to%20be%20declared%20somewhere%20else%20(but%20I%20haven't%20found%20anything).%3C%2FP%3E%3CPRE%3E%23%20Create%20Compliance%20Search%20-%20Export%20Email%0A%0A%24SearchName%20%3D%20%22Export%20-%20%22%20%2B%20%24term.Name%0ANew-ComplianceSearch%20-ExchangeLocation%20%24term365.UserPrincipalName%20-Name%20%24SearchName%0A%0A%23%20Start%20Compliance%20Search%20and%20wait%20to%20complete%0A%0AStart-ComplianceSearch%20%24SearchName%0Ado%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20Start-Sleep%20-s%205%0A%20%20%20%20%20%20%20%20%24complianceSearch%20%3D%20Get-ComplianceSearch%20%24SearchName%0A%20%20%20%20%7D%0Awhile%20(%24complianceSearch.Status%20-ne%20'Completed')%0A%0A%23%20Create%20Compliance%20Search%20in%20exportable%20format%0ANew-ComplianceSearchAction%20-SearchName%20%24SearchName%20-Export%20-ArchiveFormat%20PerUserPST%20-EnableDedupe%20%24true%20%0A%24ExportName%20%3D%20%24SearchName%20%2B%20%22_Export%22%0A%0A%23Wait%20for%20Export%20to%20complete%0Ado%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20Start-Sleep%20-s%205%0A%20%20%20%20%20%20%20%20%24complete%20%3D%20Get-ComplianceSearchAction%20-Identity%20%24ExportName%0A%20%20%20%20%7D%0Awhile%20(%24complete.Status%20-ne%20'Completed')%3C%2FPRE%3E%3CP%3EAny%20help%20would%20be%20appreciated!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-95007%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECompliance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-444842%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-444842%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229846%22%20target%3D%22_blank%22%3E%40Tom%20Aguero%3C%2FA%3E%26nbsp%3BCan%20you%20share%20the%20whole%20script%20to%20download%20pst%20physically%20from%20EXO%20mailboxes%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275502%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275502%22%20slang%3D%22en-US%22%3E%3CP%3EOh%20nice!%20I%20forgot%20I%20parsed%20that%20and%20didn't%20even%20think%20about%20polling%20the%20server-side%20progress.%3C%2FP%3E%3CP%3EThe%20only%20thing%20I%20can%20see%20being%20an%20issue%20is%20if%20it's%20a%20very%20large%20export%2C%20or%20you%20have%20a%20slow%20connection%2C%20your%20session%20with%20office%20365%20might%20timeout%20before%20it's%20done.%3C%2FP%3E%3CP%3EI'll%20try%20adding%20it%20to%20our%20implementation%20and%20see%20if%20I%20run%20into%20any%20problems.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAre%26nbsp%3Byou%20logging%20the%20entire%20session%20with%20a%20transcript%3F%20If%20not%2C%20I'd%20recommend%26nbsp%3Bwriting%20the%20progress%20to%20a%20file%20so%20you%20can%20quickly%20check%20if%20it%20finished%20or%20not%2C%20in%20case%20your%20computer%20restarts%20for%20windows%20updates%20or%20something%20while%20you're%20not%20looking.%20%22Write-Output%20%24Progress%20%7C%20Out-File%22%20is%20quick%20and%20easy%2C%20but%20you%20might%20want%20to%20include%20a%20timestamp%20as%20well.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275453%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275453%22%20slang%3D%22en-US%22%3E%3CP%3EAwesome%2C%20I%20got%20it%20working%20and%20I%20figured%20out%20a%20way%20to%20monitor%20the%20process%20along%20with%20the%20percent%20complete.%20Sorry%2C%20I'm%20not%20sure%20how%20to%20do%20the%20fancy%20formatting%20for%20this%20post.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%23Do%20while%20microsoft.office.client.discovery.unifiedexporttool.exe%20running%3CBR%20%2F%3E%24started%20%3D%20%24false%3CBR%20%2F%3EDo%20%7B%20%24status%20%3D%20Get-Process%20microsoft.office.client.discovery.unifiedexporttool%20-ErrorAction%20SilentlyContinue%3CBR%20%2F%3EIf%20(!(%24status))%20%7B%3C%2FP%3E%3CP%3EWrite-Host%20'Waiting%20for%20process%20to%20start'%20%3B%20Start-Sleep%20-Seconds%205%20%7D%3C%2FP%3E%3CP%3EElse%20%7B%3C%2FP%3E%3CP%3EWrite-Host%20'Process%20has%20started'%20%3B%20%24started%20%3D%20%24true%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3E%7DUntil%20(%20%24started%20)%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%7B%3C%2FP%3E%3CP%3E%24ProcessesFound%20%3D%20Get-Process%20%7C%20%3F%20%7B%24_.Name%20-like%20%22*unifiedexporttool*%22%7D%3CBR%20%2F%3EIf%20(%24ProcessesFound)%20%7B%20%24%3C%2FP%3E%3CP%3EProgress%20%3D%20get-ComplianceSearchAction%20-Identity%20%24exportname%20-IncludeCredential%20-Details%20%7C%20select%20-ExpandProperty%20Results%20%7C%20ConvertFrom-String%20-TemplateContent%20%24exporttemplate%20%7C%20%25%7B%24_.Progress%7D%3CBR%20%2F%3EWrite-Host%20%22Export%20still%20downloading%2C%20progress%20is%20%24Progress%2C%20waiting%2060%20seconds%22%3CBR%20%2F%3EStart-Sleep%20-s%2060%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3E%7DUntil%20(!%24ProcessesFound)%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275326%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275326%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20this%20still%20worked%20quite%20well%20as%20of%20a%20week%20ago.%20I%20can%20only%20see%20this%20breaking%20if%20Microsoft%20changes%20the%20format%20of%20the%20%22Results%22%20property%20of%20the%20content%20search%20or%20splits%20it%20into%20separate%20properties%20of%20their%20own.%3C%2FP%3E%3CP%3EI%20haven't%20made%20any%20real%20improvements%20to%20it%2C%20but%20this%20reminds%20me%20that%20I%20should%20probably%20combine%20my%20code%20with%20Brad's%20so%20that%20there's%20a%20minimally%20functional%20example.%20I'll%20edit%20my%20previous%20post%20at%20some%20time%20for%20that.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20container%20URL%20comes%20from%20the%20%22%24exportdetails%20%3D%22%20line.%3C%2FP%3E%3CP%3EIt%20first%20gets%20the%20compliance%20search%2C%20selects%20the%20Results%20property%20that%20contains%20the%20container%20URL%2C%20then%20parses%20the%20URL%20and%20token%20from%20the%20property%20using%20the%20%24exporttemplate%3C%2FP%3E%3CP%3EThe%20results%20property%20is%20just%20one%20giant%20string%20of%20information%2C%20instead%20of%20separate%20properties%20of%20their%20own%2C%20so%20parsing%20it%20with%20Convert-FromString%20was%20the%20easiest%20way%20I%20could%20think%20of%20to%20get%20those%20properties.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConvert-FromString%20requires%20a%20template%20consisting%20of%20at%20least%20two%20lines%20of%20data%2C%20formatted%20so%20that%20it%20knows%20what%20you're%20looking%20to%20parse.%20The%20data%20in%20%24exporttemplate%26nbsp%3Bis%20just%26nbsp%3Btwo%20of%20our%20old%20searches%2C%20modified%20with%20the%20parsing%20tags.%20Sorry%20if%20that's%20not%20incredibly%20clear.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275299%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275299%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20this%20still%20working%20for%20you%3F%20Have%20you%20made%20any%20changes%2Fimprovements%20since%20you%20posted%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow'd%20you%20get%20the%26nbsp%3Bcontainer%20URL%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192375%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192375%22%20slang%3D%22en-US%22%3E%3CP%3EClickOnce%20has%20been%20deprecated%20by%20Google%20but%20is%20still%20supported%20in%20current%20builds...%20That's%20why%20it%20still%20works%20in%20the%20old%20interface%2C%20but%20it%20is%20blocked%20in%20the%20new%20interface.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192372%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192372%22%20slang%3D%22en-US%22%3EYes%2C%20that's%20what%20I%20saw%20before%20clicking%20'Export'%20(second%20screen%20shot).%20When%20I%20clicked%20it%20I%20got%20the%20error%20box%20that%20complains%20about%20'failed%20to%20find%20parameter'.%20I%20was%20in%20IE%20when%20failing%20to%20export%20the%20results%20in%20the%20new%20UI.%20Trying%20a%20test%20export%20to%20get%20you%20a%20screen%20shot%20is%20failing%20now%20though.%20Apparently%20after%20one%20export%20went%20through%20others%20are%20working%20just%20fine%20in%20both%20browsers.%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20for%20chrome%20not%20working%2C%20the%20ClickOnce%20extension%20still%20works%20for%20me.%20Is%20it%20failing%20for%20you%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192354%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192354%22%20slang%3D%22en-US%22%3E%3CP%3EContent%20search%20exports%20are%20different%20in%20the%20new%20experience.%20For%20one%20thing%2C%20you%20can%20no%20longer%20use%20Chrome%20to%20export%20search%20results%20because%20Google%20has%20deprecated%20the%20feature%20Microsoft%20used%20to%20download%20and%20launch%20the%20export%20app.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20I%20have%20certainly%20been%20able%20to%20export%20information%20from%20a%20content%20search.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F33891iFF38B584FF754308%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Search2.jpg%22%20title%3D%22Search2.jpg%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExport%20from%20a%20content%20search%3C%2FSPAN%3E%3C%2FSPAN%3ELeading%20to%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20678px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F33892i9F3E0FE911A24C2E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Search3.jpg%22%20title%3D%22Search3.jpg%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExport%20options%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIsn't%20that%20what%20you%20see%20in%20the%20new%20experience%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192329%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192329%22%20slang%3D%22en-US%22%3E%3CP%3EI%20hate%20to%20bring%20back%20old%20threads%2C%20but%20it's%20always%20nice%20to%20find%20info%20in%20threads%20that%20show%20up%20high%20on%20search%20results.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20of%20today%20(05%2F10%2F2018)%20the%20export%20error%20still%20exists.%20However%2C%20swapping%20back%20to%20the%20%22old%20experience%22%20and%20using%20the%20export%20results%20link%20in%20the%20right%20column%20still%20works.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142582%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142582%22%20slang%3D%22en-US%22%3E%3CP%3EOK.%20Then%20it's%20time%20to%20log%20a%20support%20call%20with%20Microsoft.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20too%20have%20some%20scripts%20that%20I%20use%20with%20searches.%20When%20I%20went%20to%20test%20one%20to%20investigate%20this%20problem%2C%20I%20also%20found%20that%20I%20had%20the%20wrong%20permissions%20and%20the%20export%20parameter%20wasn't%20available.%20After%20I%20amended%20permissions%20and%20restarted%20the%20PowerShell%20session%2C%20all%20was%20well...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142580%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142580%22%20slang%3D%22en-US%22%3EIt%20is.%20We%20have%20both%20been%20using%20a%20script%20to%20do%20this%20for%20some%20time.%20The%20error%20returned%20is%20that%20the%20export%20flag%20does%20not%20exist.%20I%20have%20exhaustively%20tested%20it.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142555%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142555%22%20slang%3D%22en-US%22%3E%3CP%3ECheck%20that%26nbsp%3Bthe%26nbsp%3Baccount%20you%20use%20to%20log%20into%20PowerShell%20is%20a%20member%20of%20the%20Compliance%20Center%20eDiscovery%20Manager%20role%20group...%20The%20account%20needs%20to%20have%20this%20right%20to%20expose%20the%20Export%20function.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142257%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142257%22%20slang%3D%22en-US%22%3E%3CP%3EI%20doubt%20it.%20The%20problem%20is%20that%20exported%20results%20are%20in%20temporary%20Azure%20storage%20that%20is%20accessed%20by%20a%20key.%20Handling%20that%20key%20in%20a%20secure%20manner%20to%20make%20it%20available%20and%20usable%20to%20a%20PowerShell%20cmdlet%20is%20something%20I%20do%20not%20think%20the%20developers%20have%20considered%20yet.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142252%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142252%22%20slang%3D%22en-US%22%3EThank%20you!%3CBR%20%2F%3EDo%20you%20know%20if%20it%20Will%20je%20possible%20to%20download%20results%20through%20powershell%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142250%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142250%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20compliance%20search%20functionality%20is%20being%20rewritten%20at%20present.%20This%20might%20have%20had%20the%20side-effect%20of%20removing%20the%20parameter.%20I%20have%20pinged%20the%20development%20team%20to%20ask.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142133%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142133%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Brad%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20was%20having%20the%20exact%20same%20issue.%3C%2FP%3E%0A%3CP%3EI%20tried%20it%20on%20thuesday%20and%20it%20failed%20to%20find%20the%20parameter%3C%2FP%3E%0A%3CP%3ETried%20it%20on%20wednesday%20and%20it%20found%20the%20parameter%3C%2FP%3E%0A%3CP%3EI%20think%20they%20are%20activly%20working%20on%20the%20cmdlet.%20I%20wouldn't%20use%20it%20in%20the%20meanwhile.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142132%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142132%22%20slang%3D%22en-US%22%3E%3CP%3EActually%2C%20even%20the%20export%20no%20longer%20works.%20I%20have%20currently%20opened%20a%20ticket%20with%20Office%20365%20to%20find%20out%20why.%20There%20is%3A%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23f5f5f5%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%3CFONT%20color%3D%22%23003366%22%3ENew-ComplianceSearchAction%20-SearchName%20%24SearchName%20-Export%3C%2FFONT%3E%20%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23ff0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EA%20parameter%20cannot%20be%20found%20that%20matches%20parameter%20name%20'Export'.%20%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3EThe%20updated%20help%20still%20shows%20the%20parameter%2C%20and%20the%20TechNet%20page%20has%20not%20been%20updated.%20However%2C%20search%20for%20it%26nbsp%3Bin%20the%20Command%20modules%20help%20in%20ISE%2C%20the%20check%20box%20for%20Export%20has%20now%20disappeared%20in%20the%20last%20week%20as%20well%20as%20the%20ArchiveFormat%20parameter.%20Can't%20find%20anything%20about%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-142124%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-142124%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20searched%20a%20lot%20but%20I%20don't%20think%20there%20is%20a%20way%20to%20download%20it%20through%20PS%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141591%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141591%22%20slang%3D%22en-US%22%3E%3CP%3EAre%20there%20eDiscovery%20PowerShell%20commands%20to%20do%20the%20export%3F%26nbsp%3B%20We%20want%20to%20export%20the%20content%20search%20results%20from%20eDiscovery%20content%20searches%20to%20a%20shared%20drive%20for%20investigators%20to%20access.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141588%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141588%22%20slang%3D%22en-US%22%3EThis%20theme%20is%20the%20powershell%2C%20Please%20i%20need%20download%20Result%20of%20search%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141559%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141559%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20Compliance%20and%20Security%20center%20go%20to%20your%20export%20and%20click%20download%20on%20the%20right%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141486%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141486%22%20slang%3D%22en-US%22%3E%3CP%3Eonce%20exported%20how%20can%20I%20download%20the%20PST%2C%20please%20your%20urgent%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141409%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141409%22%20slang%3D%22en-US%22%3E%3CP%3EBrad%20to%20the%20rescue%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141408%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141408%22%20slang%3D%22en-US%22%3EThank%20you%20for%20the%20answer.%3CBR%20%2F%3EI%20was%20indeed%20looking%20for%20a%20way%20to%20physical%20exporting%20for%20the%20search.%20Guess%20I%20will%20have%20to%20do%20that%20manually.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141406%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141406%22%20slang%3D%22en-US%22%3E%3CP%3ETo%20clarify%2C%20everything%20up%20to%20the%20physical%20exporting%20can%20be%20scripted%20with%20basic%20existing%20cmdlets.%20To%20do%20the%20actual%20export%2C%20you%20would%20have%20to%20write%20some%20additional%20code%20to%20do%20this%20via%20the%20GUI%2C%20as%20there%20is%20currently%20no%20cmdlet%20to%20grab%20the%20export%20and%20save%20it%20locally.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20scriplet%20regarding%20this%20function%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23006400%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%23%20Create%20Compliance%20Search%20-%20Export%20Email%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24SearchName%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%3D%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%22Export%20-%20%22%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%2B%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24term%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E.%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EName%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3ENew-ComplianceSearch%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-ExchangeLocation%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24user365%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E.%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EWindowsLiveID%20%3C%2FFONT%3E%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-Name%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24SearchName%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23%20Start%20Compliance%20Search%20and%20wait%20to%20complete%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EStart-ComplianceSearch%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24SearchName%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Edo%3C%2FP%3E%0A%3CP%3E%7B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EStart-Sleep%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-s%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E5%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24complianceSearch%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%3D%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EGet-ComplianceSearch%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24SearchName%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%7D%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%2300008b%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3Ewhile%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%20(%3C%2FFONT%3E%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24complianceSearch%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E.%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EStatus%20%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-ne%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E'Completed'%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E)%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23%20Create%20Compliance%20Search%20in%20exportable%20format%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3ENew-ComplianceSearchAction%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-SearchName%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24SearchName%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-EnableDedupe%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24true%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-Export%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-Format%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238a2be2%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EFxStream%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-ArchiveFormat%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238a2be2%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EPerUserPST%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23Wait%20for%20Export%20to%20complete%3C%2FP%3E%0A%3CP%3Edo%3C%2FP%3E%0A%3CP%3E%7B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EStart-Sleep%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-s%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E5%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24complete%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%3D%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EGet-ComplianceSearchAction%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-Identity%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24ExportName%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%7D%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%2300008b%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3Ewhile%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%20(%3C%2FFONT%3E%3CFONT%20color%3D%22%23ff4500%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E%24complete%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E.%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EStatus%20%3C%2FFONT%3E%3CFONT%20color%3D%22%23a9a9a9%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-ne%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E'Completed'%3C%2FFONT%3E%3CFONT%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E)%3C%2FFONT%3E%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141405%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141405%22%20slang%3D%22en-US%22%3EIs%20it%20possible%20for%20me%20to%20create%20a%20PS%20script%20that%20downloads%20PST's%20through%20e%20discovery%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141401%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141401%22%20slang%3D%22en-US%22%3E%3CP%3EThrough%20E-Discovery%20yes%2C%20not%20through%20regular%20Exchange%20Online.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20third-party%20tools%20out%20there%20that%20have%20created%20tools%20for%20this.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-141022%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-141022%22%20slang%3D%22en-US%22%3EHi%20Vasil%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20you%20are%20saying%20there%20is%20no%20way%20to%20export%20a%20user's%20mailbox%20through%20PowerShell%3F%3CBR%20%2F%3E%3CBR%20%2F%3EKind%20regards%3CBR%20%2F%3EThijs%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-95030%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-95030%22%20slang%3D%22en-US%22%3E%3CP%3ENo%20way%20to%20do%20it%20without%20going%20to%20the%20SCC%20and%20initializing%20the%20download%20via%20the%20click-one%20app%2C%20sorry.%26nbsp%3BPerhaps%20you%20can%20automate%20it%20via%20AzCopy%20or%20some%20other%20tool%20that%20takes%20container%2Ftoken%20as%20input%20-%20you%20can%20get%20those%20via%20the%20Result%20property%20of%20Get-ComplianceSearchAction.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20for%20the%20cmdlet%2C%20make%20sure%20you%20also%20use%20the%20-Format%20parameter!%3C%2FP%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CP%3EThe%20Format%20parameter%20specifies%20the%20format%20of%20the%20search%20results%20when%20you%20use%20the%20Export%20switch.%20Valid%20values%20are%3A%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EFxStream%26nbsp%3B%26nbsp%3B%20Export%20to%20PST%20files.%20This%20is%20the%20only%20option%20that's%20available%20when%20you%20export%20search%20results%20from%20the%20Security%20%26amp%3B%20Compliance%20Center.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EMime%26nbsp%3B%26nbsp%3B%20Export%20to%20.eml%20messsage%20files.%20This%20the%20default%20value%20when%20you%20use%20cmdlets%20to%20export%20the%20search%20results.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EIt's%20most%20likely%20what%20causes%20the%20issue%20in%20your%20case.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-445127%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-445127%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F94211%22%20target%3D%22_blank%22%3E%40Edgar%20Guerrero%3C%2FA%3E%26nbsp%3BSure%2C%20I%20think%20I%20sanitized%20it%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%23region%20Connect%20to%20all%20the%20things%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23Test%20O365%20Connection%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%24Null%3C%2FSPAN%3E%20%3CSPAN%3E-eq%3C%2FSPAN%3E%20%3CSPAN%3E%24O365Cred%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24O365Cred%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%20%24Host%3C%2FSPAN%3E%3CSPAN%3E.ui.PromptForCredential%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22Enter%20your%20OFFICE%20365%20admin%20creds%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22ENTER%20YOUR%20ACCOUNT%20NAME%20HERE%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ETry%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CSPAN%3EGet-O365Mailbox%3C%2FSPAN%3E%3CSPAN%3E%20aguerot%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EErrorAction%20Stop%20%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%3E%24Null%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECatch%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24O365Session%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ENew-PSSession%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConfigurationName%20Microsoft.Exchange%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConnectionUri%20https%3A%3C%2FSPAN%3E%3CSPAN%3E%2F%2F%3C%2FSPAN%3E%3CSPAN%3Eoutlook.office365.com%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3Epowershell%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Eliveid%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ECredential%20%3C%2FSPAN%3E%3CSPAN%3E%24O365Cred%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EAuthentication%20Basic%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EAllowRedirection%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EImport-PSSession%3C%2FSPAN%3E%20%3CSPAN%3E%24O365Session%3C%2FSPAN%3E%3CSPAN%3E%20%E2%80%93Prefix%20o365%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ETry%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CSPAN%3EGet-MsolUser%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EUserPrincipalName%20ENTER%20TEST%20USER%20HERE%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EErrorAction%20Stop%20%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%3E%24Null%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECatch%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CSPAN%3EConnect-MsolService%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ECredential%20%3C%2FSPAN%3E%3CSPAN%3E%24O365Cred%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ETry%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3CSPAN%3EGet-ComplianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%3E%24Null%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECatch%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23Get%20login%20credentials%20%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Session%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ENew-PSSession%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConfigurationName%20Microsoft.Exchange%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConnectionUri%20https%3A%3C%2FSPAN%3E%3CSPAN%3E%2F%2F%3C%2FSPAN%3E%3CSPAN%3Eps.compliance.protection.outlook.com%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3Epowershell%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Eliveid%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ECredential%20%3C%2FSPAN%3E%3CSPAN%3E%24O365Cred%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EAuthentication%20Basic%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EAllowRedirection%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EImport-PSSession%3C%2FSPAN%3E%20%3CSPAN%3E%24Session%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EAllowClobber%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EDisableNameChecking%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23endregion%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Get%20User%20Info%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24User%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ERead-host%3C%2FSPAN%3E%20%3CSPAN%3E%22Enter%20user%20name%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%24Logfile%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%22PATH%20TO%20LOG%20FILE%5C%3C%2FSPAN%3E%3CSPAN%3E%24User%3C%2FSPAN%3E%3CSPAN%3E.txt%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3EFunction%3C%2FSPAN%3E%20%3CSPAN%3ELogWrite%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EParam%3C%2FSPAN%3E%3CSPAN%3E%20(%5B%3C%2FSPAN%3E%3CSPAN%3Estring%3C%2FSPAN%3E%3CSPAN%3E%5D%3C%2FSPAN%3E%3CSPAN%3E%24logstring%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%24LogString%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAdd-content%3C%2FSPAN%3E%20%3CSPAN%3E%24Logfile%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Evalue%20%3C%2FSPAN%3E%3CSPAN%3E%24logstring%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Date%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-Date%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EFormat%20%3C%2FSPAN%3E%3CSPAN%3E%22MM%2Fdd%2Fyyyy%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%24Date%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22Username%3A%20%3C%2FSPAN%3E%3CSPAN%3E%24User%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Begin%20Compliance%20Search%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24UPN%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ADUser%3C%2FSPAN%3E%20%3CSPAN%3E%24User%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EForEach-Object%3C%2FSPAN%3E%3CSPAN%3E%7B%24_%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24User%3C%2FSPAN%3E%20%3CSPAN%3E%2B%3C%2FSPAN%3E%20%3CSPAN%3E%22_Termed%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ENew-ComplianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EName%20%3C%2FSPAN%3E%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EExchangeLocation%20%3C%2FSPAN%3E%3CSPAN%3E%24UPN%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-ComplianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogwrite%20%3C%2FSPAN%3E%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22Compliance%20search%20%3C%2FSPAN%3E%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%3CSPAN%3E%20started%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDo%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24complianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ComplianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EForEach-Object%3C%2FSPAN%3E%3CSPAN%3E%7B%24_%3C%2FSPAN%3E%3CSPAN%3E.Status%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Compliance%20Search%20in%20Progress%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Sleep%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Es%20%3C%2FSPAN%3E%3CSPAN%3E30%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWhile%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24complianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E-ne%3C%2FSPAN%3E%20%3CSPAN%3E'Completed'%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Size%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ComplianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EForEach-Object%3C%2FSPAN%3E%3CSPAN%3E%7B%24_%3C%2FSPAN%3E%3CSPAN%3E.Size%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Size%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24Size%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%20%3CSPAN%3E1048576%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EOut-String%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Size%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24Size.SubString%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E6%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23%20Create%20Compliance%20Search%20in%20exportable%20format%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ENew-ComplianceSearchAction%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ESearchName%20%3C%2FSPAN%3E%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EEnableDedupe%20%3C%2FSPAN%3E%3CSPAN%3E%24true%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EExport%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EFormat%20FxStream%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EArchiveFormat%20PerUserPST%20%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%3E%24Null%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Wait%20for%20Export%20to%20complete%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24ExportName%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E%2B%3C%2FSPAN%3E%20%3CSPAN%3E%22_Export%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Sleep%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Es%20%3C%2FSPAN%3E%3CSPAN%3E20%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Edo%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24SearchAction%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ComplianceSearchAction%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EIdentity%20%3C%2FSPAN%3E%3CSPAN%3E%24ExportName%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3ESelect-Object%3C%2FSPAN%3E%3CSPAN%3E%20Status%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EJobProgress%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Status%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchAction.Status%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24ExportProgress%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchAction.JobProgress%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Export%20in%20progress%2C%20%3C%2FSPAN%3E%3CSPAN%3E%24ExportProgress%3C%2FSPAN%3E%3CSPAN%3E%20complete%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%24Status%3C%2FSPAN%3E%20%3CSPAN%3E-ne%3C%2FSPAN%3E%20%3CSPAN%3E%22Completed%22%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Sleep%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Es%20%3C%2FSPAN%3E%3CSPAN%3E60%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ewhile%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24Status%3C%2FSPAN%3E%20%3CSPAN%3E-ne%3C%2FSPAN%3E%20%3CSPAN%3E'Completed'%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22Compliance%20search%20completed%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Taken%20from%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FOffice-365%2FExport-to-PST-via-Powershell%2Fm-p%2F193934%2Fhighlight%2Ffalse%23M13088%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FOffice-365%2FExport-to-PST-via-Powershell%2Fm-p%2F193934%2Fhighlight%2Ffalse%23M13088%3C%2FA%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exportlocation%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%22C%3A%5Cpst%22%3C%2FSPAN%3E%20%3CSPAN%3E%23enter%20the%20path%20to%20your%20export%20here%20!NO%20TRAILING%20BACKSLASH!%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exportexe%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%22%5CUnifiedExportTool%5Cmicrosoft.office.client.discovery.unifiedexporttool.exe%22%3C%2FSPAN%3E%20%3CSPAN%3E%23path%20to%20your%20microsoft.office.client.discovery.unifiedexporttool.exe%20file.%20Usually%20found%20somewhere%20in%20ForEach-ObjectLOCALAPPDATAForEach-Object%5CApps%5C2.0%5C%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23%20Gather%20the%20URL%20and%20Token%20from%20the%20export%20in%20order%20to%20start%20the%20download%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23We%20only%20need%20the%20ContainerURL%20and%20SAS%20Token%20but%20I%20parsed%20some%20other%20fields%20as%20well%20while%20working%20with%20AzCopy%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23The%20Container%20URL%20and%20Token%20in%20the%20following%20template%20has%20been%20altered%20to%20protect%20the%20innocent%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exporttemplate%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%40'%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EContainer%20url%3A%20%7BContainerURL*%3A%3CA%20href%3D%22https%3A%2F%2Fxicnediscnam.blob.core.windows.net%2Fda3fecb0-4ed4-447e-0315-08d5adad8a5a%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fxicnediscnam.blob.core.windows.net%2Fda3fecb0-4ed4-447e-0315-08d5adad8a5a%3C%2FA%3E%7D%3B%20SAS%20token%3A%20%7BSASToken%3A%3Fsv%3D2014-02-14%26amp%3Bsr%3Dc%26amp%3Bsi%3DeDiscoveryBlobPolicy9ForEach-Object7C0%26amp%3Bsig%3DRACMSyH6Cf0k4EP2wZSoAa0QrhKaV38Oa9ciHv5Y8MkForEach-Object3D%7D%3B%20Scenario%3A%20General%3B%20Scope%3A%20BothIndexedAndUnindexedItems%3B%20Scope%20details%3A%20AllUnindexed%3B%20Max%20unindexed%20size%3A%200%3B%20File%20type%20exclusions%20for%20unindexed%3A%20%3CNULL%3E%3B%20Total%20sources%3A%202%3B%20Exchange%20item%20format%3A%20Msg%3B%20Exchange%20archive%20format%3A%20IndividualMessage%3B%20SharePoint%20archive%20format%3A%20SingleZip%3B%20Include%20SharePoint%20versions%3A%20True%3B%20Enable%20dedupe%3A%20EnableDedupe%3ATrue%3B%20Reference%20action%3A%20%22%3CNULL%3E%22%3B%20Region%3A%20%3B%20Started%20sources%3A%20StartedSources%3A3%3B%20Succeeded%20sources%3A%20SucceededSources%3A1%3B%20Failed%20sources%3A%200%3B%20Total%20estimated%20bytes%3A%2012%2C791%2C334%2C934%3B%20Total%20estimated%20items%3A%20143%2C729%3B%20Total%20transferred%20bytes%3A%20%7BTotalTransferredBytes%3A7%2C706%2C378%2C435%7D%3B%20Total%20transferred%20items%3A%20%7BTotalTransferredItems%3A71%2C412%7D%3B%20Progress%3A%20%7BProgress%3A49.69%20ForEach-Object%7D%3B%20Completed%20time%3A%20%3B%20Duration%3A%2000%3A50%3A43.9321895%3B%20Export%20status%3A%20%7BExportStatus%3ADistributionCompleted%7D%3C%2FNULL%3E%3C%2FNULL%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EContainer%20url%3A%20%7BContainerURL*%3A%3CA%20href%3D%22https%3A%2F%2Fzgrbediscnam.blob.core.windows.net%2F5c21f7c7-42a2-4e24-9e69-08d5acf316f5%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fzgrbediscnam.blob.core.windows.net%2F5c21f7c7-42a2-4e24-9e69-08d5acf316f5%3C%2FA%3E%7D%3B%20SAS%20token%3A%20%7BSASToken%3A%3Fsv%3D2014-02-14%26amp%3Bsr%3Dc%26amp%3Bsi%3DeDiscoveryBlobPolicy9ForEach-Object7C0%26amp%3Bsig%3DF6ycaX5eWcRBCS1Z5nfoTKJWTrHkAciqbYRP5ForEach-Object2FhsUOoForEach-Object3D%7D%3B%20Scenario%3A%20General%3B%20Scope%3A%20BothIndexedAndUnindexedItems%3B%20Scope%20details%3A%20AllUnindexed%3B%20Max%20unindexed%20size%3A%200%3B%20File%20type%20exclusions%20for%20unindexed%3A%20%3CNULL%3E%3B%20Total%20sources%3A%201%3B%20Exchange%20item%20format%3A%20FxStream%3B%20Exchange%20archive%20format%3A%20PerUserPst%3B%20SharePoint%20archive%20format%3A%20IndividualMessage%3B%20Include%20SharePoint%20versions%3A%20True%3B%20Enable%20dedupe%3A%20True%3B%20Reference%20action%3A%20%22%3CNULL%3E%22%3B%20Region%3A%20%3B%20Started%20sources%3A%202%3B%20Succeeded%20sources%3A%202%3B%20Failed%20sources%3A%200%3B%20Total%20estimated%20bytes%3A%2069%2C952%2C559%2C461%3B%20Total%20estimated%20items%3A%20107%2C707%3B%20Total%20transferred%20bytes%3A%20%7BTotalTransferredBytes%3A70%2C847%2C990%2C489%7D%3B%20Total%20transferred%20items%3A%20%7BTotalTransferredItems%3A100%2C808%7D%3B%20Progress%3A%20%7BProgress%3A93.59%20ForEach-Object%7D%3B%20Completed%20time%3A%204%2F27%2F2018%2011%3A45%3A46%20PM%3B%20Duration%3A%2004%3A31%3A21.1593737%3B%20Export%20status%3A%20%7BExportStatus%3ACompleted%7D%3C%2FNULL%3E%3C%2FNULL%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E'%40%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exportdetails%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ComplianceSearchAction%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EIdentity%20%3C%2FSPAN%3E%3CSPAN%3E%24exportname%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EIncludeCredential%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EDetails%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3ESelect-Object%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EExpandProperty%20Results%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EConvertFrom-String%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ETemplateContent%20%3C%2FSPAN%3E%3CSPAN%3E%24exporttemplate%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exportdetails%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exportcontainerurl%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24exportdetails.ContainerURL%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24exportsastoken%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24exportdetails.SASToken%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23%20Download%20the%20exported%20files%20from%20Office%20365%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Compliance%20Search%20Size%3A%22%3C%2FSPAN%3E%20%3CSPAN%3E%24Size%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22Initiating%20download%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22Saving%20export%20to%3A%20%3C%2FSPAN%3E%3CSPAN%3E%24exportlocation%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24arguments%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%22-name%20%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%24searchname%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22-source%20%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%24exportcontainerurl%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22-key%20%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%24exportsastoken%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22-dest%20%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%24exportlocation%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%22-trace%20true%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Process%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EFilePath%20%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%24exportexe%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EArgumentList%20%3C%2FSPAN%3E%3CSPAN%3E%24arguments%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Do%20while%20microsoft.office.client.discovery.unifiedexporttool.exe%20running%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24started%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24false%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDo%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24status%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-Process%3C%2FSPAN%3E%3CSPAN%3E%20microsoft.office.client.discovery.unifiedexporttool%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EErrorAction%20SilentlyContinue%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3E!%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%24status%3C%2FSPAN%3E%3CSPAN%3E))%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E'Waiting%20for%20process%20to%20start'%3C%2FSPAN%3E%3CSPAN%3E%20%3B%20%3C%2FSPAN%3E%3CSPAN%3EStart-Sleep%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ESeconds%20%3C%2FSPAN%3E%3CSPAN%3E5%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EElse%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E'Process%20has%20started'%3C%2FSPAN%3E%3CSPAN%3E%20%3B%20%3C%2FSPAN%3E%3CSPAN%3E%24started%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24true%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EUntil%3C%2FSPAN%3E%3CSPAN%3E%20(%20%3C%2FSPAN%3E%3CSPAN%3E%24started%3C%2FSPAN%3E%3CSPAN%3E%20)%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3EDo%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Finished%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24False%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-host%3C%2FSPAN%3E%20%3CSPAN%3E%22Sleeping%20300%20seconds%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Sleep%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Es%20%3C%2FSPAN%3E%3CSPAN%3E300%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-Childitem%3C%2FSPAN%3E%20%3CSPAN%3E%22C%3A%5Cpst%22%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Erecurse%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Einclude%20%3C%2FSPAN%3E%3CSPAN%3E*%3C%2FSPAN%3E%3CSPAN%3E.pst%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EForEach-Object%3C%2FSPAN%3E%3CSPAN%3E%7B%24_%3C%2FSPAN%3E%3CSPAN%3E.Length%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%20%3CSPAN%3E1048576%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EOut-String%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24DownloadSize.SubString%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E6%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Compliance%20Search%20Size%3A%22%3C%2FSPAN%3E%20%3CSPAN%3E%24Size%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Downloaded%20Size%3A%22%3C%2FSPAN%3E%20%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26lt%3B%23%23%20Commenting%20this%20out%20to%20test%20performance%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24ProcessesFound%20%3D%20Get-Process%20%7C%20%3F%20%7B%24_.Name%20-like%20%22*unifiedexporttool*%22%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%20%22Process%20still%20running%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%20(%24ProcessesFound)%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Progress%20%3D%20get-ComplianceSearchAction%20-Identity%20%24exportname%20-IncludeCredential%20-Details%20%7C%20Select-Object%20-ExpandProperty%20Results%20%7C%20ConvertFrom-String%20-TemplateContent%20%24exporttemplate%20%7C%20ForEach-Object%7B%24_.Progress%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%20%22Export%20still%20downloading%2C%20progress%20is%20%24Progress%2C%20waiting%20300%20seconds%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EStart-Sleep%20-s%20300%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23%26gt%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E-ge%3C%2FSPAN%3E%20%3CSPAN%3E%24Size%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24status%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-Process%3C%2FSPAN%3E%3CSPAN%3E%20microsoft.office.client.discovery.unifiedexporttool%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EErrorAction%20SilentlyContinue%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3E!%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%24status%3C%2FSPAN%3E%3CSPAN%3E))%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Download%20has%20finished%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Finished%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24True%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3EUntil%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24Finished%3C%2FSPAN%3E%20%3CSPAN%3E-eq%3C%2FSPAN%3E%20%3CSPAN%3E%24True%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-Childitem%3C%2FSPAN%3E%20%3CSPAN%3E%22C%3A%5Cpst%22%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Erecurse%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Einclude%20%3C%2FSPAN%3E%3CSPAN%3E*%3C%2FSPAN%3E%3CSPAN%3E.pst%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EForEach-Object%3C%2FSPAN%3E%3CSPAN%3E%7B%24_%3C%2FSPAN%3E%3CSPAN%3E.Length%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%20%3CSPAN%3E1048576%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EOut-String%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24DownloadSize.SubString%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E6%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Compliance%20Search%20Size%3A%22%3C%2FSPAN%3E%20%3CSPAN%3E%24Size%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Downloaded%20Size%3A%22%3C%2FSPAN%3E%20%3CSPAN%3E%24DownloadSize%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Read-Host%20%22Pausing%20script%20until%20you%20verify%20download.%20Seriously.%20If%20the%20download%20isn't%20done%20this%20gets%20really%20bad.%20You%20sure%20you're%20ready%3F%20Press%20enter%20to%20continue%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22PST%20exported%20%26amp%3B%20downloaded%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Remove%20compliance%20search%20%26amp%3B%20export%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24ExportName%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E%2B%3C%2FSPAN%3E%20%3CSPAN%3E%22_Export%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ERemove-ComplianceSearchAction%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EIdentity%20%3C%2FSPAN%3E%3CSPAN%3E%24ExportName%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConfirm%3A%3C%2FSPAN%3E%3CSPAN%3E%24False%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ERemove-ComplianceSearch%3C%2FSPAN%3E%20%3CSPAN%3E%24SearchName%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConfirm%3A%3C%2FSPAN%3E%3CSPAN%3E%24False%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E(%24%3C%2FSPAN%3E%3CSPAN%3E%3F%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Compliance%20search%20%26amp%3B%20export%20removed%22%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Get%20%26amp%3B%20Remove%20O365%20licenses%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24UPN2%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ADUser%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EIdentity%20%3C%2FSPAN%3E%3CSPAN%3E%24User%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EForEach-Object%3C%2FSPAN%3E%3CSPAN%3E%7B%24_%3C%2FSPAN%3E%3CSPAN%3E.UserPrincipalName%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24MSOLUser%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-MsolUser%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EUserPrincipalName%20%3C%2FSPAN%3E%3CSPAN%3E%24UPN2%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EErrorAction%20SilentlyContinue%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23%24IsLicensed%20%3D%20%24MSOLUser.IsLicensed%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24Licenses%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%24MSOLUser.Licenses%3C%2FSPAN%3E%3CSPAN%3E%5B%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%5D.AccountSkuId%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ESet-MsolUserLicense%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EUserPrincipalName%20%3C%2FSPAN%3E%3CSPAN%3E%24UPN2%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ERemoveLicenses%20%3C%2FSPAN%3E%3CSPAN%3E%24Licenses%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E(%24%3C%2FSPAN%3E%3CSPAN%3E%3F%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%24User%3C%2FSPAN%3E%20%3CSPAN%3E%24Licenses%3C%2FSPAN%3E%3CSPAN%3E%20removed%22%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Move%20to%20Disabled%20Accts%20OU%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EGet-AdUser%3C%2FSPAN%3E%20%3CSPAN%3E%24User%3C%2FSPAN%3E%20%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EMove-AdObject%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ETargetPath%20%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%20%3CSPAN%3E%23Moves%20to%20an%20OU%20that%20doesnt%20sync%20to%20O365%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELogWrite%20%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3CSPAN%3E%24User%3C%2FSPAN%3E%3CSPAN%3E%20account%20has%20been%20moved%20to%20Disabled%20Accts%20OU%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Run%20DirSync%20on%20Azure%20AD%20Connect%20sync%20server%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EInvoke-Command%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EComputername%20%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EScriptBlock%20%7BC%3A%5CDirSync%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EForceDelta.ps1%7D%20%3C%2FSPAN%3E%3CSPAN%3E%23Runs%20an%20Azure%20AD%20Connect%20Directory%20sync%20on%20a%20remote%20server%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Move%20PST%20for%20upload%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EGet-Childitem%3C%2FSPAN%3E%20%3CSPAN%3E%22C%3A%5Cpst%22%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Erecurse%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3Einclude%20%3C%2FSPAN%3E%3CSPAN%3E*%3C%2FSPAN%3E%3CSPAN%3E.pst%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EMove-Item%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EDestination%20%3C%2FSPAN%3E%3CSPAN%3E%22C%3A%5Cpst%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Upload%20mailbox%20to%20Azure%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Uploading%20to%20Azure%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3EStart-Process%3C%2FSPAN%3E%20%3CSPAN%3E%22Disable%20User%20Process%5CLaunchCmd-Custom.cmd%22%3C%2FSPAN%3E%20%3CSPAN%3E%23Customized%20Azure%20Storage%20AZ%20copy%20upload%20script%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%23Confirm%20upload%20to%20finished%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24confirmation%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3ERead-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22Did%20Azure%20upload%20complete%20successfully%3F%20You%20need%20to%20enter%20y%20here%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eif%3C%2FSPAN%3E%3CSPAN%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24confirmation%3C%2FSPAN%3E%20%3CSPAN%3E-eq%3C%2FSPAN%3E%20%3CSPAN%3E'y'%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%23Delete%20pst%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ERemove-Item%3C%2FSPAN%3E%20%3CSPAN%3E%22C%3A%5Cpst%5C*%22%3C%2FSPAN%3E%20%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3ERecurse%20%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3EConfirm%3A%3C%2FSPAN%3E%3CSPAN%3E%24False%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E(%24%3C%2FSPAN%3E%3CSPAN%3E%3F%3C%2FSPAN%3E%3CSPAN%3E)%7B%3C%2FSPAN%3E%3CSPAN%3EWrite-host%3C%2FSPAN%3E%20%3CSPAN%3E%22%20%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%3E%22PST%20Deleted%22%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAlso%2C%20here%20is%20the%20AZ%20copy%20script%2C%20you%20need%20to%20get%20your%20own%20key%20and%20destination%20info.%20I%20honestly%20forget%20how%20to%20get%20that.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%40echo%3C%2FSPAN%3E%3CSPAN%3E%20off%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Etitle%20Microsoft%20Azure%20Storage%20tools%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eset%20LaunchCmdFolder%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%22C%3A%5CProgram%20Files%20(x86)%5CMicrosoft%20SDKs%5CAzure%5CAzCopy%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eset%20PATH%3C%2FSPAN%3E%3CSPAN%3E%3D%25%3C%2FSPAN%3E%3CSPAN%3EPATH%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3ELaunchCmdFolder%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3EAzCopy%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3ESet%20azcopy%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%22C%3A%5CProgram%20Files%20(x86)%5CMicrosoft%20SDKs%5CAzure%5CAzCopy%5CAzCopy.exe%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESet%20source%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%22C%3A%5Cpst%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESet%20dest%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eset%20key%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3Eazcopy%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3Esource%3A%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3Esource%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3EDest%3A%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3Edest%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3EDestKey%3A%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%3CSPAN%3Ekey%3C%2FSPAN%3E%3CSPAN%3E%25%3C%2FSPAN%3E%20%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3EPattern%3A%3C%2FSPAN%3E%3CSPAN%3E*%3C%2FSPAN%3E%3CSPAN%3E.pst%20%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3ES%20%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3EV%3AC%3A%5CAZCopy.log%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3EPause%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1357754%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1357754%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229846%22%20target%3D%22_blank%22%3E%40Tom%20Aguero%3C%2FA%3E%26nbsp%3BThanks%20for%20the%20help%20so%20far.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20not%20able%20to%20start%20the%20export.%3C%2FP%3E%3CP%3EFrom%20the%20tracert%20file%20i%20got%20this%20message%3A%3CBR%20%2F%3EUnhandled%20Exception%3A%20System.IO.FileNotFoundException%3A%20Could%20not%20load%20file%20or%20assembly%20'Microsoft.Office.Client.Discovery.UnifiedExport%2C%20Version%3D15.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D31bf3856ad364e35'%20or%20one%20of%20its%20dependencies.%20The%20system%20cannot%20find%20the%20file%20specified.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20I%20need%20to%20do%20something%20with%20the%26nbsp%3BMicrosoft.Office.Client.Discovery.UnifiedExportTool.application%20file%20or%20should%20it%20work%20with%26nbsp%3BContainer%20url%20and%26nbsp%3BSAS%20token%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20fund%20this%20(he%20has%20stolen%20some%20part%20from%20you).%20Still%20no%20luck.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.reddit.com%2Fr%2FPowerShell%2Fcomments%2Fba4fpu%2Fautomated_download_of_o365_inbox_archive%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.reddit.com%2Fr%2FPowerShell%2Fcomments%2Fba4fpu%2Fautomated_download_of_o365_inbox_archive%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20is%20appreciated%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1358053%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1358053%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F646783%22%20target%3D%22_blank%22%3E%40Powershell_mannen69%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20looks%20like%20the%20export%20tool%20can't%20load%20one%20of%20it's%20dependency%20files.%20Did%20you%20copy%20the%20exe%20out%20of%20your%20profile%20folder%20without%20all%20the%20rest%20of%20the%20files%3F%20And%2C%20are%20you%20using%20Tom%20Aguero's%20code%3F%20If%20so%2C%20try%20replacing%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24exportexe%26nbsp%3B%3D%26nbsp%3B%22%5CUnifiedExportTool%5Cmicrosoft.office.client.discovery.unifiedexporttool.exe%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewith%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24exportexe%20%3D%20((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20microsoft.office.client.discovery.unifiedexporttool.exe%20-Recurse).FullName%20%7C%20Where-Object%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20Select-Object%20-First%201)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20see%20if%20that%20helps%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20should%20find%20the%20exe%20within%20your%20profile%2C%20without%20having%20to%20copy%20the%20file%20or%20use%20any%20static%20paths%2C%20which%20should%20help%20if%20you%20have%20multiple%20people%20that%20may%20run%20the%20script.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20thanks%20for%20the%20Reddit%20link%2C%20I%20like%20their%20way%20of%20pulling%20the%20URL%20and%20token%20much%20better!%20I'll%20have%20to%20try%20it%20out%20on%20the%20next%20run%20of%20the%20script.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdditionally%2C%20If%20anyone%20wants%20to%20automate%20downloading%20the%20unified%20export%20tool%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23%20Check%20if%20the%20export%20tool%20is%20installed%20for%20the%20user%2C%20and%20download%20if%20not.%0AWhile%20(-Not%20((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20microsoft.office.client.discovery.unifiedexporttool.exe%20-Recurse).FullName%20%7C%20Where-Object%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20Select-Object%20-First%201))%7B%0A%20%20%20%20Write-Host%20%22Downloading%20Unified%20Export%20Tool%20.%22%0A%20%20%20%20Write-Host%20%22This%20is%20installed%20per-user%20by%20the%20Click-Once%20installer.%22%0A%20%20%20%20%23%20Credit%20to%20Jos%20Verlinde%20for%20his%20code%20in%20Load-ExchangeMFA%20in%20the%20Powershell%20Gallery!%20All%20I've%20done%20is%20update%20the%20manifest%20url%20and%20remove%20all%20the%20comments%0A%20%20%20%20%23%20Ripped%20from%20https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FLoad-ExchangeMFA%2F1.2%0A%20%20%20%20%23%20In%20case%20anyone%20else%20has%20any%20ClickOnce%20applications%20they'd%20like%20to%20automate%20the%20install%20for%3A%0A%20%20%20%20%23%20If%20you're%20looking%20for%20where%20to%20find%20a%20manifest%20URL%2C%20once%20you%20have%20run%20the%20ClickOnce%20application%20at%20least%20once%20on%20your%20computer%2C%20the%20url%20for%20the%20application%20manifest%20can%20be%20found%20in%20the%20Windows%20Registry%20at%20%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CUninstall%22%20(yes%2C%20CTR%20apps%20are%20installed%20per-user).%0A%20%20%20%20%23%20Look%20through%20the%20keys%20with%20names%20that%20are%2016%20characters%20long%20hex%20strings.%20They'll%20have%20a%20string%20value%20(REG_SZ)%20named%20either%20%22ShortcutAppId%22%20or%20%22UrlUpdateInfo%22%20that%20contains%20the%20URL%20as%20the%20first%20part%20of%20the%20string.%0A%20%20%20%20%24Manifest%20%3D%20%22https%3A%2F%2Fcomplianceclientsdf.blob.core.windows.net%2Fv16%2FMicrosoft.Office.Client.Discovery.UnifiedExportTool.application%22%0A%20%20%20%20%24ElevatePermissions%20%3D%20%24true%0A%20%20%20%20Try%20%7B%0A%20%20%20%20%20%20%20%20Add-Type%20-AssemblyName%20System.Deployment%0A%20%20%20%20%20%20%20%20Write-Host%20%22Starting%20installation%20of%20ClickOnce%20Application%20%24Manifest%20%22%0A%20%20%20%20%20%20%20%20%24RemoteURI%20%3D%20%5BURI%5D%3A%3ANew(%20%24Manifest%20%2C%20%5BUriKind%5D%3A%3AAbsolute)%0A%20%20%20%20%20%20%20%20if%20(-not%20%20%24Manifest)%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20%22Invalid%20ConnectionUri%20parameter%20'%24ConnectionUri'%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%24HostingManager%20%3D%20New-Object%20System.Deployment.Application.InPlaceHostingManager%20-ArgumentList%20%24RemoteURI%20%2C%20%24False%0A%20%20%20%20%20%20%20%20Register-ObjectEvent%20-InputObject%20%24HostingManager%20-EventName%20GetManifestCompleted%20-Action%20%7B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20new-event%20-SourceIdentifier%20%22ManifestDownloadComplete%22%0A%20%20%20%20%20%20%20%20%7D%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20Register-ObjectEvent%20-InputObject%20%24HostingManager%20-EventName%20DownloadApplicationCompleted%20-Action%20%7B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20new-event%20-SourceIdentifier%20%22DownloadApplicationCompleted%22%0A%20%20%20%20%20%20%20%20%7D%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20%24HostingManager.GetManifestAsync()%0A%20%20%20%20%20%20%20%20%24event%20%3D%20Wait-Event%20-SourceIdentifier%20%22ManifestDownloadComplete%22%20-Timeout%2015%0A%20%20%20%20%20%20%20%20if%20(%24event%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24event%20%7C%20Remove-Event%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22ClickOnce%20Manifest%20Download%20Completed%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%24HostingManager.AssertApplicationRequirements(%24ElevatePermissions)%0A%20%20%20%20%20%20%20%20%20%20%20%20%24HostingManager.DownloadApplicationAsync()%0A%20%20%20%20%20%20%20%20%20%20%20%20%24event%20%3D%20Wait-Event%20-SourceIdentifier%20%22DownloadApplicationCompleted%22%20-Timeout%2060%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24event%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24event%20%7C%20Remove-Event%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22ClickOnce%20Application%20Download%20Completed%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-error%20%22ClickOnce%20Application%20Download%20did%20not%20complete%20in%20time%20(60s)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-error%20%22ClickOnce%20Manifest%20Download%20did%20not%20complete%20in%20time%20(15s)%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20finally%20%7B%0A%20%20%20%20%20%20%20%20Get-EventSubscriber%7C%3F%20%7B%24_.SourceObject.ToString()%20-eq%20'System.Deployment.Application.InPlaceHostingManager'%7D%20%7C%20Unregister-Event%0A%20%20%20%20%7D%0A%7D%0A%0A%24exportexe%20%3D%20((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20microsoft.office.client.discovery.unifiedexporttool.exe%20-Recurse).FullName%20%7C%20Where-Object%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20Select-Object%20-First%201)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-193934%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-193934%22%20slang%3D%22en-US%22%3E%3CP%3ESo%2C%20I've%20been%20fighting%20to%20automate%20using%20powershell%20to%20export%20a%20PST%20from%20Office%20365%20off%20and%20on%20for%20a%20while.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAzCopy%20worked%20great%20for%20Sharepoint%2FOneDrive%20exports%2C%20but%20exchange%20data%20all%20came%20down%20as%20%22.batch%22%20files%2C%20which%20appear%20to%20need%20further%20post-processing%20to%20collect%20everything%20into%20a%20PST.%20Someone%20better%20than%20I%20might%20know%20how%20to%20piece%20them%20together%2C%20but%20I%20just%26nbsp%3Bmoved%20on.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20a%20bit%20of%20a%20workaround%20but%20here's%20what%20I%20did%20to%20automate%20the%20PST%20download.%3C%2FP%3E%3CP%3EWhen%20you%20manually%20download%20the%20export%20using%20the%20export%20tool%2C%20the%20click-once%20popup%20downloads%20their%20%22Unified%26nbsp%3BExport%20Tool%22%20and%20populates%20it%20with%20what%20it%20needs%20to%20get%20it%20going.%20While%20it's%20open%2C%20you%20can%20right-click%20the%20process%20in%20task%20manager%20and%20click%20%22Open%20file%20location%22.%20This%20will%20take%20you%20to%20the%20files%20their%20tool%20uses%2C%20in%20your%20appdata.%20For%20me%2C%20this%20location%20was%20%22%25LOCALAPPDATA%25%5CApps%5C2.0%5CQBKH9EZX.XMP%5C7R4KYC02.WJ7%5Cmicr..tool_51a5b647dacf4059_000f.0014_a4b60912e622c727%5C%22%3C%2FP%3E%3CP%3EI'm%20sure%20Microsoft%20updates%20the%20tool%20every%20now%20and%20then%2C%20so%20this%20path%20may%20not%20work%20indefinitely.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyways%2C%20I%20just%20copied%20everything%20to%20a%20new%20folder%20(I%20don't%20recommend%20doing%20this%2C%20i%20provide%20an%20example%20to%20find%20the%20file%20automatically%20in%20the%20script%20below)%20and%20ran%20the%20%22microsoft.office.client.discovery.unifiedexporttool.exe%22%20which%20returned%20the%20parameters%20that%20it%20accepts.%20Much%20like%20AzCopy%2C%20it%20looks%20for%20the%20URL%2C%20Token%2C%20and%20a%20place%20to%20drop%20the%20files.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20what%20I%20slapped%20together%20to%20automatically%20download%20the%20export%20from%20Office%20365%3A%3C%2FP%3E%3CP%3E%3CEM%3EThe%20code%20below%20has%20been%20edited%20since%20this%20post%20was%20created%20to%20include%20improvements%20to%20the%20original%20code%20and%20provide%20a%20start%20to%20finish%20example%20to%20export%20and%20download%20a%20PST.%20If%20you%20want%20to%20use%20this%20as%20a%20user%20off-boarding%20script%20you'll%20need%20to%20add%20those%20tasks%20as%20well.%20Everyone%20has%20their%20own%20processes%2C%20but%20Tom%20Aguero's%20post%20below%20has%20some%20good%20examples%20too.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23%20Note%20that%20I'm%20not%20validating%20any%20input%20or%20providing%20any%20adequate%20error%20handling.%0A%23%20This%20is%20just%20an%20example%2C%20you'll%20need%20to%20add%20these%20in%20yourself.%0A%0AParam(%0A%20%20%20%20%5BParameter(Mandatory%3D%24True%2C%20HelpMessage%3D'Enter%20the%20email%20address%20that%20you%20want%20to%20export')%5D%0A%20%20%20%20%24Mailbox%2C%0A%20%20%20%20%5BParameter(Mandatory%3D%24True%2C%20HelpMessage%3D'Enter%20the%20URL%20for%20the%20user''s%20OneDrive%20here.%20If%20you%20don''t%20enter%20one%2C%20this%20will%20be%20skipped.')%5D%0A%20%20%20%20%24OneDriveURL%2C%0A%20%20%20%20%5BParameter(Mandatory%3D%24True%2C%20HelpMessage%3D'Enter%20the%20path%20where%20you%20want%20to%20save%20the%20PST%20file.%20!NO%20TRAILING%20BACKSLASH!')%5D%0A%20%20%20%20%24ExportLocation%20%23%20%3D%20%22%22%23%20you%20can%20un-comment%20the%20%3D%20%22%22%20to%20set%20a%20default%20for%20this%20parameter.%0A)%0A%0A%23%20Create%20a%20search%20name.%20You%20can%20change%20this%20to%20suit%20your%20preference%0A%24SearchName%20%3D%20%22%24Mailbox%20PST%22%0A%0A%23%20I'm%20using%20the%20Exchange%20Online%20Powershell%20Module%20v2.%20You%20can%20install%20it%20from%20an%20admin%20session%20with%20the%20following%20command%3A%20Install-Module%20ExchangeOnlineManagement%0AWrite-Host%20%22Connecting%20to%20Exchange%20Online.%20Enter%20your%20admin%20credentials%20in%20the%20pop-up%20(pop-under%3F)%20window.%22%0AConnect-IPPSSession%0A%0AWrite-Host%20%22Creating%20compliance%20search...%22%0ANew-ComplianceSearch%20-Name%20%24SearchName%20-ExchangeLocation%20%24Mailbox%20-SharePointLocation%20%24OneDriveURL%20-AllowNotFoundExchangeLocationsEnabled%20%24true%20%23Create%20a%20content%20search%2C%20including%20the%20the%20entire%20contents%20of%20the%20user's%20email%20and%20onedrive.%20If%20you%20didn't%20provide%20a%20OneDrive%20URL%2C%20or%20it%20wasn't%20valid%2C%20it%20will%20be%20ignored.%0AWrite-Host%20%22Starting%20compliance%20search...%22%0AStart-ComplianceSearch%20-Identity%20%24SearchName%20%23Start%20the%20search%20created%20above%0AWrite-Host%20%22Waiting%20for%20compliance%20search%20to%20complete...%22%0Afor%20(%24SearchStatus%3B%24SearchStatus%20-notlike%20%22Completed%22%3B)%7B%20%23Wait%20then%20check%20if%20the%20search%20is%20complete%2C%20loop%20until%20complete%0A%20%20%20%20Start-Sleep%20-s%202%0A%20%20%20%20%24SearchStatus%20%3D%20Get-ComplianceSearch%20%24SearchName%20%7C%20Select-Object%20-ExpandProperty%20Status%20%23Get%20the%20status%20of%20the%20search%0A%20%20%20%20Write-Host%20-NoNewline%20%22.%22%20%23%20Show%20some%20sort%20of%20status%20change%20in%20the%20terminal%0A%7D%0AWrite-Host%20%22Compliance%20search%20is%20complete!%22%0AWrite-Host%20%22Creating%20export%20from%20the%20search...%22%0ANew-ComplianceSearchAction%20-SearchName%20%24SearchName%20-Export%20-Format%20FxStream%20-ExchangeArchiveFormat%20PerUserPst%20-Scope%20BothIndexedAndUnindexedItems%20-EnableDedupe%20%24true%20-SharePointArchiveFormat%20IndividualMessage%20-IncludeSharePointDocumentVersions%20%24true%20%0AStart-Sleep%20-s%205%20%23%20Arbitrarily%20wait%205%20seconds%20to%20give%20microsoft's%20side%20time%20to%20create%20the%20SearchAction%20before%20the%20next%20commands%20try%20to%20run%20against%20it.%20I%20%2FCOULD%2F%20do%20a%20for%20loop%20and%20check%2C%20but%20it's%20really%20not%20worth%20it.%0A%0A%23%20Check%20if%20the%20export%20tool%20is%20installed%20for%20the%20user%2C%20and%20download%20if%20not.%0AWhile%20(-Not%20((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20microsoft.office.client.discovery.unifiedexporttool.exe%20-Recurse).FullName%20%7C%20Where-Object%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20Select-Object%20-First%201))%7B%0A%20%20%20%20Write-Host%20%22Downloading%20Unified%20Export%20Tool%20.%22%0A%20%20%20%20Write-Host%20%22This%20is%20installed%20per-user%20by%20the%20Click-Once%20installer.%22%0A%20%20%20%20%23%20Credit%20to%20Jos%20Verlinde%20for%20his%20code%20in%20Load-ExchangeMFA%20in%20the%20Powershell%20Gallery!%20All%20I've%20done%20is%20update%20the%20manifest%20url%20and%20remove%20all%20the%20comments%0A%20%20%20%20%23%20Ripped%20from%20https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FLoad-ExchangeMFA%2F1.2%0A%20%20%20%20%23%20In%20case%20anyone%20else%20has%20any%20ClickOnce%20applications%20they'd%20like%20to%20automate%20the%20install%20for%3A%0A%20%20%20%20%23%20If%20you're%20looking%20for%20where%20to%20find%20a%20manifest%20URL%2C%20once%20you%20have%20run%20the%20ClickOnce%20application%20at%20least%20once%20on%20your%20computer%2C%20the%20url%20for%20the%20application%20manifest%20can%20be%20found%20in%20the%20Windows%20Registry%20at%20%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CUninstall%22%20(yes%2C%20CTR%20apps%20are%20installed%20per-user).%0A%20%20%20%20%23%20Look%20through%20the%20keys%20with%20names%20that%20are%2016%20characters%20long%20hex%20strings.%20They'll%20have%20a%20string%20value%20(REG_SZ)%20named%20either%20%22ShortcutAppId%22%20or%20%22UrlUpdateInfo%22%20that%20contains%20the%20URL%20as%20the%20first%20part%20of%20the%20string.%0A%20%20%20%20%24Manifest%20%3D%20%22https%3A%2F%2Fcomplianceclientsdf.blob.core.windows.net%2Fv16%2FMicrosoft.Office.Client.Discovery.UnifiedExportTool.application%22%0A%20%20%20%20%24ElevatePermissions%20%3D%20%24true%0A%20%20%20%20Try%20%7B%0A%20%20%20%20%20%20%20%20Add-Type%20-AssemblyName%20System.Deployment%0A%20%20%20%20%20%20%20%20Write-Host%20%22Starting%20installation%20of%20ClickOnce%20Application%20%24Manifest%20%22%0A%20%20%20%20%20%20%20%20%24RemoteURI%20%3D%20%5BURI%5D%3A%3ANew(%20%24Manifest%20%2C%20%5BUriKind%5D%3A%3AAbsolute)%0A%20%20%20%20%20%20%20%20if%20(-not%20%20%24Manifest)%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20%22Invalid%20ConnectionUri%20parameter%20'%24ConnectionUri'%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%24HostingManager%20%3D%20New-Object%20System.Deployment.Application.InPlaceHostingManager%20-ArgumentList%20%24RemoteURI%20%2C%20%24False%0A%20%20%20%20%20%20%20%20Register-ObjectEvent%20-InputObject%20%24HostingManager%20-EventName%20GetManifestCompleted%20-Action%20%7B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20new-event%20-SourceIdentifier%20%22ManifestDownloadComplete%22%0A%20%20%20%20%20%20%20%20%7D%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20Register-ObjectEvent%20-InputObject%20%24HostingManager%20-EventName%20DownloadApplicationCompleted%20-Action%20%7B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20new-event%20-SourceIdentifier%20%22DownloadApplicationCompleted%22%0A%20%20%20%20%20%20%20%20%7D%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20%24HostingManager.GetManifestAsync()%0A%20%20%20%20%20%20%20%20%24event%20%3D%20Wait-Event%20-SourceIdentifier%20%22ManifestDownloadComplete%22%20-Timeout%2015%0A%20%20%20%20%20%20%20%20if%20(%24event%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24event%20%7C%20Remove-Event%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22ClickOnce%20Manifest%20Download%20Completed%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%24HostingManager.AssertApplicationRequirements(%24ElevatePermissions)%0A%20%20%20%20%20%20%20%20%20%20%20%20%24HostingManager.DownloadApplicationAsync()%0A%20%20%20%20%20%20%20%20%20%20%20%20%24event%20%3D%20Wait-Event%20-SourceIdentifier%20%22DownloadApplicationCompleted%22%20-Timeout%2060%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24event%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24event%20%7C%20Remove-Event%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22ClickOnce%20Application%20Download%20Completed%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-error%20%22ClickOnce%20Application%20Download%20did%20not%20complete%20in%20time%20(60s)%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-error%20%22ClickOnce%20Manifest%20Download%20did%20not%20complete%20in%20time%20(15s)%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20finally%20%7B%0A%20%20%20%20%20%20%20%20Get-EventSubscriber%7C%3F%20%7B%24_.SourceObject.ToString()%20-eq%20'System.Deployment.Application.InPlaceHostingManager'%7D%20%7C%20Unregister-Event%0A%20%20%20%20%7D%0A%7D%0A%0A%23%20Find%20the%20Unified%20Export%20Tool's%20location%20and%20create%20a%20variable%20for%20it%0A%24ExportExe%20%3D%20((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20microsoft.office.client.discovery.unifiedexporttool.exe%20-Recurse).FullName%20%7C%20Where-Object%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20Select-Object%20-First%201)%0A%0A%23%20Gather%20the%20URL%20and%20Token%20from%20the%20export%20in%20order%20to%20start%20the%20download%0A%23%20We%20only%20need%20the%20ContainerURL%20and%20SAS%20Token%20at%20a%20minimum%20but%20we're%20also%20pulling%20others%20to%20help%20with%20tracking%20the%20status%20of%20the%20export.%0A%24ExportName%20%3D%20%24SearchName%20%2B%20%22_Export%22%0A%24ExportDetails%20%3D%20Get-ComplianceSearchAction%20-Identity%20%24ExportName%20-IncludeCredential%20-Details%20%23%20Get%20details%20for%20the%20export%20action%0A%23%20This%20method%20of%20splitting%20the%20Container%20URL%20and%20Token%20from%20%24ExportDetails%20is%20thanks%20to%20schmeckendeugler%20from%20reddit%3A%20https%3A%2F%2Fwww.reddit.com%2Fr%2FPowerShell%2Fcomments%2Fba4fpu%2Fautomated_download_of_o365_inbox_archive%2F%0A%23%20I%20was%20using%20Convert-FromString%20before%2C%20which%20was%20slow%20and%20terrible.%20His%20way%20is%20MUCH%20better.%0A%24ExportDetails%20%3D%20%24ExportDetails.Results.split(%22%3B%22)%0A%24ExportContainerUrl%20%3D%20%24ExportDetails%5B0%5D.trimStart(%22Container%20url%3A%20%22)%0A%24ExportSasToken%20%3D%20%24ExportDetails%5B1%5D.trimStart(%22%20SAS%20token%3A%20%22)%0A%24ExportEstSize%20%3D%20(%24ExportDetails%5B18%5D.TrimStart(%22%20Total%20estimated%20bytes%3A%20%22)%20-as%20%5Bdouble%5D)%0A%24ExportTransferred%20%3D%20(%24ExportDetails%5B20%5D.TrimStart(%22%20Total%20transferred%20bytes%3A%20%22)%20-as%20%5Bdouble%5D)%0A%24ExportProgress%20%3D%20%24ExportDetails%5B22%5D.TrimStart(%22%20Progress%3A%20%22).TrimEnd(%22%25%22)%0A%24ExportStatus%20%3D%20%24ExportDetails%5B25%5D.TrimStart(%22%20Export%20status%3A%20%22)%0A%0A%23%20Download%20the%20exported%20files%20from%20Office%20365%0AWrite-Host%20%22Initiating%20download%22%0AWrite-Host%20%22Saving%20export%20to%3A%20%22%20%2B%20%24ExportLocation%0A%24Arguments%20%3D%20%22-name%20%22%22%24SearchName%22%22%22%2C%22-source%20%22%22%24ExportContainerUrl%22%22%22%2C%22-key%20%22%22%24ExportSasToken%22%22%22%2C%22-dest%20%22%22%24ExportLocation%22%22%22%2C%22-trace%20true%22%0AStart-Process%20-FilePath%20%22%24ExportExe%22%20-ArgumentList%20%24Arguments%0A%0A%23%20The%20export%20is%20now%20downloading%20in%20the%20background.%20You%20can%20find%20it%20in%20task%20manager.%20Let's%20monitor%20the%20progress.%0A%23%20If%20you%20want%20to%20use%20this%20as%20part%20of%20a%20user%20offboarding%20script%2C%20add%20your%20edits%20above%20here%20-%20Exports%20can%20take%20a%20lot%20of%20time...%0A%23%20You%20can%20even%20comment%20this%20entire%20section%20and%20exit%20the%20script%20if%20you%20dont%20feel%20the%20need%20to%20monitor%20the%20download%2C%20it%20will%20keep%20downloading%20in%20the%20background%20even%20without%20the%20script%20running.%0A%23%20This%20is%20only%20monitoring%20if%20the%20process%20exists%2C%20which%20means%20if%20you%20run%20multiple%20exports%2C%20this%20will%20stay%20running%20until%20they%20all%20complete.%0A%23%20We%20could%20possibly%20utilize%20sysinternals%20handle.exe%20to%20identify%20the%20PID%20of%20the%20process%20writing%20to%20the%20%24Exportlocation%20and%20monitor%20for%20that%20specifically%2C%20but%20I'm%20trying%20to%20limit%20external%20applications%20in%20this%20example%20script.%0A%23%0A%23%20Just%20an%20FYI%2C%20the%20export%20progress%20is%20how%20much%20data%20Microsoft%20has%20copied%20into%20PSTs%20from%20the%20compliance%20search%2C%20not%20how%20much%20the%20export%20tool%20has%20downloaded.%0A%23%20We%20only%20know%20the%20actual%20size%20of%20the%20download%20after%20the%20%24ExportProgress%20is%20100%25%20and%20%24ExportStatus%20is%20Completed%0A%23%20The%20actual%20final%20size%20of%20the%20download%20is%20then%20reflected%20in%20%24ExportTransferred.%20Even%20then%2C%20our%20progress%20is%20still%20a%20bit%20inaccurate%20due%20to%20the%20extra%20log%20and%20temp%20files%20created%20locally%2C%20which%20will%20probably%20cause%20the%20progress%20to%20show%20over%20100%25%0A%23%20We%20could%20make%20this%20a%20bit%20more%20accurate%20by%20just%20collecting%20the%20size%20of%20PSTs%20and%20files%20under%20the%20OneDrive%20folder%2C%20but%20I%20think%20this%20brings%20us%20close%20enough%20for%20most%20situations.%0Awhile(Get-Process%20microsoft.office.client.discovery.unifiedexporttool%20-ErrorAction%20SilentlyContinue)%7B%0A%20%20%20%20%24Downloaded%20%3D%20Get-ChildItem%20%24ExportLocation%5C%24SearchName%20-Recurse%20%7C%20Measure-Object%20-Property%20Length%20-Sum%20%7C%20Select-Object%20-ExpandProperty%20Sum%0A%20%20%20%20Write-Progress%20-Id%201%20-Activity%20%22Export%20in%20Progress%22%20-Status%20%22Complete...%22%20-PercentComplete%20%24ExportProgress%0A%20%20%20%20if%20(%22Completed%22%20-notlike%20%24ExportStatus)%7BWrite-Progress%20-Id%202%20-Activity%20%22Download%20in%20Progress%22%20-Status%20%22Estimated%20Complete...%22%20-PercentComplete%20(%24Downloaded%2F%24ExportEstSize*100)%20-CurrentOperation%20%22%24Downloaded%2F%24ExportEstSize%20bytes%20downloaded.%22%7D%0A%20%20%20%20else%20%7BWrite-Progress%20-Id%202%20-Activity%20%22Download%20in%20Progress%22%20-Status%20%22Complete...%22%20-PercentComplete%20(%24Downloaded%2F%24ExportEstSize*100)%20-CurrentOperation%20%22%24Downloaded%2F%24ExportTransferred%20bytes%20downloaded.%22%7D%0A%20%20%20%20Start-Sleep%2060%0A%20%20%20%20%24ExportDetails%20%3D%20Get-ComplianceSearchAction%20-Identity%20%24ExportName%20-IncludeCredential%20-Details%20%23%20Get%20details%20for%20the%20export%20action%0A%20%20%20%20%24ExportDetails%20%3D%20%24ExportDetails.Results.split(%22%3B%22)%0A%20%20%20%20%24ExportEstSize%20%3D%20(%24ExportDetails%5B18%5D.TrimStart(%22%20Total%20estimated%20bytes%3A%20%22)%20-as%20%5Bdouble%5D)%0A%20%20%20%20%24ExportTransferred%20%3D%20(%24ExportDetails%5B20%5D.TrimStart(%22%20Total%20transferred%20bytes%3A%20%22)%20-as%20%5Bdouble%5D)%0A%20%20%20%20%24ExportProgress%20%3D%20%24ExportDetails%5B22%5D.TrimStart(%22%20Progress%3A%20%22).TrimEnd(%22%25%22)%0A%20%20%20%20%24ExportStatus%20%3D%20%24ExportDetails%5B25%5D.TrimStart(%22%20Export%20status%3A%20%22)%0A%20%20%20%20Write-Host%20-NoNewline%20%22%20.%22%0A%7D%0AWrite-Host%20%22Download%20Complete!%22%0Apause%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20nice%20part%20about%20this%20is%20the%20unified%20export%20tool%20includes%20it's%20own%20wait%20loop%20that%20checks%20the%20status%20of%20the%20export%2C%20so%20you%20don't%20have%20to%20create%20your%20own%20and%20worry%20about%20credential%20timeout%2C%20etc.%20Thanks%20to%20this%2C%20you%20can%20kick%20off%20the%20download%20and%20move%20on%20to%20other%20tasks%20in%20your%20off-boarding%20script.%3C%2FP%3E%3CP%3EIn%20production%2C%20I've%20written%20this%20to%20execute%20the%20download%20on%20a%20separate%20terminal%20using%20Invoke-Command%20and%20email%20the%20team%20a%20transcript%20when%20the%20download's%20done.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDrawbacks%3A%3C%2FP%3E%3CP%3EThe%20only%20way%20you%20know%20it's%20running%20is%20the%20process%20shows%20up%20in%20task%20manager.%3C%2FP%3E%3CP%3EThe%20only%20way%20you%20know%20it's%20done%20is%20it's%20not%20in%20task%20manager.%20We%20can%20estimate%20how%20far%20along%20it%20is%2C%20but%20it%20isn't%20perfectly%20accurate.%20You%20definitely%20want%20to%20rely%20on%20the%20trace%20files%20to%20know%20if%20everything%20went%20OK.%3C%2FP%3E%3CP%3EIf%20the%20export%20gets%20stopped%20for%20some%20reason%20(lost%20internet%2C%20restart%20due%20to%20windows%20updates%2C%20etc.)%20it%20does%20not%20resume%20the%20download%20when%20started%20again.%20I%20haven't%20been%20able%20to%20figure%20out%20how%20to%20get%20that%20to%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyways%2C%20I%20wanted%20to%20give%20back%20to%20the%20thread%20that%20helped%20me%20get%20this%20far.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1477425%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1477425%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147200%22%20target%3D%22_blank%22%3E%40Jonathon%20Chupinsky%3C%2FA%3E%26nbsp%3B%20Thank%20you%20for%20sharing%20the%20powershell%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20got%20an%20error%20when%20started%20to%20the%20export.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20trace.log%20I%20got%20this%20error%3A%3C%2FP%3E%3CP%3E%5B5%5D%5BInformation%5D%3A%20Start%20result%20recorder%20loop.%3CBR%20%2F%3E%5B1%5D%5BError%5D%3A%20Fatal%20error%20happened.%20System.UnauthorizedAccessException%3A%20Access%20to%20the%20path%20'.%5Cx86'%20is%20denied.%3CBR%20%2F%3Eat%20System.IO.__Error.WinIOError(Int32%20errorCode%2C%20String%20maybeFullPath)%3CBR%20%2F%3Eat%20System.IO.Directory.InternalCreateDirectory(String%20fullPath%2C%20String%20path%2C%20Object%20dirSecurityObj%2C%20Boolean%20checkHost)%3CBR%20%2F%3Eat%20System.IO.Directory.InternalCreateDirectoryHelper(String%20path%2C%20Boolean%20checkHost)%3CBR%20%2F%3Eat%20Microsoft.Office.Client.Discovery.UnifiedExport.Engine.Lite.LiteExportEngine.LoadDBBinaries()%3CBR%20%2F%3Eat%20Microsoft.Office.Client.Discovery.UnifiedExport.Engine.Lite.LiteExportEngine.%3CSERVERJOBMONITORLOOP%3Ed__7.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3Eat%20Microsoft.Office.Client.Discovery.UnifiedExport.Engine.Lite.LiteExportEngine.%3CEXECUTE%3Ed__4.MoveNext()%3CBR%20%2F%3E%5B1%5D%5BInformation%5D%3A%20Start%20to%20cancel%20the%20export.%3C%2FEXECUTE%3E%3C%2FSERVERJOBMONITORLOOP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20know%20where%20the%20folder%20'.%5Cx86'%20is%20and%20how%20to%20set%20the%20permission%20of%20this%20folder%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1477452%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1477452%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147200%22%20target%3D%22_blank%22%3E%40Jonathon%20Chupinsky%3C%2FA%3E%26nbsp%3BThank%20you%20for%20sharing%20your%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20get%20a%20problem%20when%20I%20started%20to%20export%20result.%3C%2FP%3E%3CP%3EFrom%20the%20trace.log%20file%20I%20got%20the%20error%3A%3C%2FP%3E%3CP%3EFatal%20error%20happened.%20System.UnauthorizedAccessException%3A%20Access%20to%20the%20path%20'.%5Cx86'%20is%20denied.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20that%2C%20the%20export%20process%20has%20been%20cancelled.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20know%20where%20is%20the%20folder%20'.%5Cx86'%20and%20how%20can%20I%20set%20the%20permission%20of%20that%20folder%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1477845%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1477845%22%20slang%3D%22en-US%22%3E%3CP%3EI%20finally%20found%20the%20reason.%20The%20script%20should%20be%20run%20by%20Powershell%20Administrator%20!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1586226%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1586226%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147200%22%20target%3D%22_blank%22%3E%40Jonathon%20Chupinsky%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20curious%20to%20know%20if%20this%20capability%20is%20available%20now%20since%20most%20of%20the%20conversation%20was%20about%20a%20year%20ago.%20I%20am%20also%20needing%20to%20automate%20the%20whole%20process%20via%20a%20script%20but%20it%20looks%20like%20the%20last%20piece%20of%20downloading%20the%20pst%20file%20is%20still%20a%20manual%20process%20from%20the%20GUI%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1586818%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20to%20PST%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1586818%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F758218%22%20target%3D%22_blank%22%3E%40Riftsan%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20everything%20still%20works%2C%20and%20I%20edited%20my%20original%20post%20a%20few%20months%20ago%20to%20include%20improvements.%3C%2FP%3E%3CP%3EThe%20actual%20downloading%20of%20the%20PST%20does%20require%20Microsoft's%20ClickOnce%20%22Universal%20Export%20Tool%22.%3C%2FP%3E%3CP%3EThe%20script%20includes%20code%20to%20automatically%20download%20the%20tool%20if%20it's%20not%20already%20on%20your%20computer%2C%20and%20download%20the%20PST%20without%20having%20to%20interact%20with%20the%20GUI.%3C%2FP%3E%3CP%3EThe%20only%20issues%20at%20this%20point%20are%20that%20we%20can't%20pull%20real%20stats%20from%20the%20local%20application%2C%20so%20we%20have%20to%20poll%20server-side%20stats%20to%20estimate%20how%20far%20along%20the%20download%20is%2C%20and%20you%20can't%20resume%20a%20download%20if%20it's%20been%20interrupted.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

I am continually expanding on my offboarding process within Orchestrator. I decided to add the export of the email so that all that has to be done is go to the Content search and download it (unless someone knows how to do that as well...). My addition works, however, instead of creating a single PST file, I end up getting the actual folders with individual email in message file format. I have tried what is correct per everything I could find (honestly, not a lot of detail on the subject). The current single line in question is:

New-ComplianceSearchAction -SearchName $SearchName -Export -ArchiveFormat PerUserPST -EnableDedupe $true 

I have tried different values for -ArchiveFormat including leaving it completely off since a single pst per user is supposed to be the default.

 

 

I will include the entire part of the script responsible for the full function in case it is supposed to be declared somewhere else (but I haven't found anything).

# Create Compliance Search - Export Email

$SearchName = "Export - " + $term.Name
New-ComplianceSearch -ExchangeLocation $term365.UserPrincipalName -Name $SearchName

# Start Compliance Search and wait to complete

Start-ComplianceSearch $SearchName
do
    {
        Start-Sleep -s 5
        $complianceSearch = Get-ComplianceSearch $SearchName
    }
while ($complianceSearch.Status -ne 'Completed')

# Create Compliance Search in exportable format
New-ComplianceSearchAction -SearchName $SearchName -Export -ArchiveFormat PerUserPST -EnableDedupe $true 
$ExportName = $SearchName + "_Export"

#Wait for Export to complete
do
    {
        Start-Sleep -s 5
        $complete = Get-ComplianceSearchAction -Identity $ExportName
    }
while ($complete.Status -ne 'Completed')

Any help would be appreciated!

 

37 Replies
best response
Solution

No way to do it without going to the SCC and initializing the download via the click-one app, sorry. Perhaps you can automate it via AzCopy or some other tool that takes container/token as input - you can get those via the Result property of Get-ComplianceSearchAction.

 

As for the cmdlet, make sure you also use the -Format parameter!


The Format parameter specifies the format of the search results when you use the Export switch. Valid values are:


FxStream   Export to PST files. This is the only option that's available when you export search results from the Security & Compliance Center.


Mime   Export to .eml messsage files. This the default value when you use cmdlets to export the search results.

 


It's most likely what causes the issue in your case.

Hi Vasil

So you are saying there is no way to export a user's mailbox through PowerShell?

Kind regards
Thijs

Through E-Discovery yes, not through regular Exchange Online. 

 

There are third-party tools out there that have created tools for this. 

Is it possible for me to create a PS script that downloads PST's through e discovery?

To clarify, everything up to the physical exporting can be scripted with basic existing cmdlets. To do the actual export, you would have to write some additional code to do this via the GUI, as there is currently no cmdlet to grab the export and save it locally.

 

Here is the scriplet regarding this function:

 

# Create Compliance Search - Export Email

$SearchName = "Export - " + $term.Name

New-ComplianceSearch -ExchangeLocation $user365.WindowsLiveID -Name $SearchName

 

# Start Compliance Search and wait to complete

Start-ComplianceSearch $SearchName

 

do

{

Start-Sleep -s 5

$complianceSearch = Get-ComplianceSearch $SearchName

 

}

while ($complianceSearch.Status -ne 'Completed')

 

# Create Compliance Search in exportable format

New-ComplianceSearchAction -SearchName $SearchName -EnableDedupe $true -Export -Format FxStream -ArchiveFormat PerUserPST

 

#Wait for Export to complete

do

{

Start-Sleep -s 5

$complete = Get-ComplianceSearchAction -Identity $ExportName

 

}

while ($complete.Status -ne 'Completed')

 

Thank you for the answer.
I was indeed looking for a way to physical exporting for the search. Guess I will have to do that manually.

Brad to the rescue

once exported how can I download the PST, please your urgent help

In Compliance and Security center go to your export and click download on the right

This theme is the powershell, Please i need download Result of search

Are there eDiscovery PowerShell commands to do the export?  We want to export the content search results from eDiscovery content searches to a shared drive for investigators to access.

I have searched a lot but I don't think there is a way to download it through PS

Actually, even the export no longer works. I have currently opened a ticket with Office 365 to find out why. There is:

New-ComplianceSearchAction -SearchName $SearchName -Export

A parameter cannot be found that matches parameter name 'Export'.

 

The updated help still shows the parameter, and the TechNet page has not been updated. However, search for it in the Command modules help in ISE, the check box for Export has now disappeared in the last week as well as the ArchiveFormat parameter. Can't find anything about it.

Hi Brad

 

I was having the exact same issue.

I tried it on thuesday and it failed to find the parameter

Tried it on wednesday and it found the parameter

I think they are activly working on the cmdlet. I wouldn't use it in the meanwhile.

The compliance search functionality is being rewritten at present. This might have had the side-effect of removing the parameter. I have pinged the development team to ask.

Thank you!
Do you know if it Will je possible to download results through powershell?

I doubt it. The problem is that exported results are in temporary Azure storage that is accessed by a key. Handling that key in a secure manner to make it available and usable to a PowerShell cmdlet is something I do not think the developers have considered yet.

Check that the account you use to log into PowerShell is a member of the Compliance Center eDiscovery Manager role group... The account needs to have this right to expose the Export function.

It is. We have both been using a script to do this for some time. The error returned is that the export flag does not exist. I have exhaustively tested it.