mirror of
https://github.com/admindroid-community/powershell-scripts.git
synced 2025-12-17 08:25:20 +00:00
Export Mailbox Hold Report
Export Mailbox Hold Report
This commit is contained in:
parent
a65047154c
commit
d09ef0cdb5
@ -1,11 +1,23 @@
|
|||||||
<#
|
<#
|
||||||
=============================================================================================
|
=============================================================================================
|
||||||
Name: Export Office 365 Email Holds Report
|
Name: Export Office 365 Mailbox Holds Report
|
||||||
Description: This script exports Office 365 Email Holds to CSV
|
Description: This script exports hold enabled mailboxes to CSV
|
||||||
Version: 1.0
|
Version: 1.0
|
||||||
website: o365reports.com
|
Website: o365reports.com
|
||||||
Script by: O365Reports Team
|
|
||||||
For detailed Script execution: http://o365reports.com/2021/06/28/export-office-365-mailbox-holds-report-using-powershell
|
Script Highlights:
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
1.Generates 4 different mailbox holds reports.
|
||||||
|
2.Automatically installs the Exchange Online module upon your confirmation when it is not available in your machine.
|
||||||
|
3.Shows list of the mailboxes with all the active holds information for each mailbox.
|
||||||
|
4.Shows the mailboxes with litigation hold enabled along with hold duration and other details.
|
||||||
|
5.Displays in-place hold applied mailboxes.
|
||||||
|
6.Lists mailboxes that are placed on retention hold and their retention policy.
|
||||||
|
7.Supports both MFA and Non-MFA accounts.
|
||||||
|
8.Exports the report in CSV format.
|
||||||
|
9.Scheduler-friendly. You can automate the report generation upon passing credentials as parameters.
|
||||||
|
|
||||||
|
For detailed Script execution: http://o365reports.com/2021/06/29/export-office-365-mailbox-holds-report-using-powershell
|
||||||
============================================================================================
|
============================================================================================
|
||||||
#>
|
#>
|
||||||
|
|
||||||
@ -199,8 +211,10 @@ $global:ExportedMailbox = 0
|
|||||||
RetrieveAllHolds
|
RetrieveAllHolds
|
||||||
|
|
||||||
if ((Test-Path -Path $global:ExportCSVFileName) -eq "True") {
|
if ((Test-Path -Path $global:ExportCSVFileName) -eq "True") {
|
||||||
Write-Host "The output file available in $global:ExportCSVFileName" -ForegroundColor Green
|
Write-Host `n" The output file available in:" -NoNewline -ForegroundColor Yellow
|
||||||
write-host "There are $global:ExportedMailbox mailboxes records in the output file"
|
Write-Host .\$global:ExportCSVFileName
|
||||||
|
Write-Host ""
|
||||||
|
Write-host "There are $global:ExportedMailbox mailboxes records in the output file" `n
|
||||||
$prompt = New-Object -ComObject wscript.shell
|
$prompt = New-Object -ComObject wscript.shell
|
||||||
$userInput = $prompt.popup("Do you want to open output file?", 0, "Open Output File", 4)
|
$userInput = $prompt.popup("Do you want to open output file?", 0, "Open Output File", 4)
|
||||||
If ($userInput -eq 6) {
|
If ($userInput -eq 6) {
|
||||||
@ -212,3 +226,5 @@ else {
|
|||||||
}
|
}
|
||||||
Disconnect-ExchangeOnline -Confirm:$false -InformationAction Ignore -ErrorAction SilentlyContinue
|
Disconnect-ExchangeOnline -Confirm:$false -InformationAction Ignore -ErrorAction SilentlyContinue
|
||||||
Write-Host "Disconnected active ExchangeOnline session"
|
Write-Host "Disconnected active ExchangeOnline session"
|
||||||
|
Write-Host `n~~ Script prepared by AdminDroid Community ~~`n -ForegroundColor Green
|
||||||
|
Write-Host "~~ Check out " -NoNewline -ForegroundColor Green; Write-Host "admindroid.com" -ForegroundColor Yellow -NoNewline; Write-Host " to get access to 1800+ Microsoft 365 reports. ~~" -ForegroundColor Green `n`n
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user