Forum Discussion
powershell for automate exiting user backup
Hello!Piero_Giacomelli
From my experience and knowledge you can use the E-Discovery/Content Search powershell module to script this up to the part of the actul export/download of the results from your search.
This is because the tool to actually download the results from E-Discovery uses a Click-One application together with a token.
So in other words, you would be able to automate the part where data is searched and secured in an E-discovery case, but the export of the results themselves would have to be done manually via the GUI.
Some powershell code to get you started.
$User = "user@domain.com"
$SearchName = "Email Backup - $($User)"
New-ComplianceSearch -Name $SearchName -ExchangeLocation $User
Start-ComplianceSearch -Name $SearchName
do
{
Start-Sleep -s 5
$complianceSearch = Get-ComplianceSearch $SearchName
}
while ($complianceSearch.Status -ne 'Completed')
New-ComplianceSearchAction -Name $SearchName -Export -ExchangeArchiveFormat PerUserPst
The above PowerShell command creates an E-Discovery/content search case for you in the name format of "Email Backup - User@domain.com"
Then it starts search for the case, and when the search is completed it starts the export action for that user.
When the export is done you would then have to actually download the PST file from SCC 🙂
Hope this helps, and If I've misunderstood your question feel free to message me or reply here and we can discuss further.
Kind Regards
Oliwer Sundgren