Hi experts please help me with powershell script.
\nI want to export my mailboxes for whom archive mailboxes are enabled or disabled, if enabled i require to export below info to csv file
\nArchive Warning Quota,
\nArchiveQuota
\nand how much its used and database on which this archive mailbox resides.<\/p>","upvoteCount":7,"answerCount":6,"datePublished":"2018-11-23T00:18:43.000Z","author":{"@type":"Person","name":"rogerroger3","url":"https://community.spiceworks.com/u/rogerroger3"},"acceptedAnswer":{"@type":"Answer","text":"
Hi,<\/p>\n
If you only need archive mailbox information, you could try this:<\/p>\n
Get-Mailbox | where {$_.ArchiveDatabase -ne $null} | \nselect name, archivedatabase, archivequota, archivewarningquota,\n@{label=\"TotalItemSize(MB)\";expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}} | \nexport-csv c:\\archiveuser.csv -append -Notype -Encoding UTF8\n\n<\/code><\/pre>","upvoteCount":0,"datePublished":"2018-11-26T07:13:46.000Z","url":"https://community.spiceworks.com/t/export-archive-mailbox-report/685166/5","author":{"@type":"Person","name":"shawlu","url":"https://community.spiceworks.com/u/shawlu"}},"suggestedAnswer":[{"@type":"Answer","text":"Hi experts please help me with powershell script.
\nI want to export my mailboxes for whom archive mailboxes are enabled or disabled, if enabled i require to export below info to csv file
\nArchive Warning Quota,
\nArchiveQuota
\nand how much its used and database on which this archive mailbox resides.<\/p>","upvoteCount":7,"datePublished":"2018-11-23T00:18:43.000Z","url":"https://community.spiceworks.com/t/export-archive-mailbox-report/685166/1","author":{"@type":"Person","name":"rogerroger3","url":"https://community.spiceworks.com/u/rogerroger3"}},{"@type":"Answer","text":"
This should do what you’re after!<\/p>\n
$DataPath = “C:\\Archiving-Quotas.csv”
\n$Results =@()
\n$Users = Get-Mailbox
\nForEach ($User in $Users)
\n{
\n$Data = Get-Mailbox -Identity $User.Alias
\n$Data | ft Name,Archive<\/em>
\nIf ($Data.ArchiveStatus -eq $true)
\n{
\n$Archiving = “Enabled”
\n$Quota = $Data.ArchiveQuota
\n$Warning = $Data.ArchiveWarningQuota
\n}
\nElse
\n{
\n$Archiving = “Disabled”
\n$Quota = “Disabled”
\n$Warning = “Disabled”
\n}
\n$TableResults = @{
\nArchiving = $Archiving
\nWarning = $Warning
\nQuota = $Quota
\nName = $User.Alias
\n}
\n$Results += New-Object psobject -Property $TableResults
\n}
\n$Results | Export-CSV -Path $DataPath<\/p>","upvoteCount":0,"datePublished":"2018-11-23T03:56:43.000Z","url":"https://community.spiceworks.com/t/export-archive-mailbox-report/685166/2","author":{"@type":"Person","name":"scottevanson","url":"https://community.spiceworks.com/u/scottevanson"}},{"@type":"Answer","text":"Just realised I’ve missed the last 2 parts you wanted. That’ll be difficult for me to test as we don’t have archiving on at all but I’ll give it a go. In the meantime that script should give you a lot of what you need.<\/p>","upvoteCount":0,"datePublished":"2018-11-23T04:05:18.000Z","url":"https://community.spiceworks.com/t/export-archive-mailbox-report/685166/3","author":{"@type":"Person","name":"scottevanson","url":"https://community.spiceworks.com/u/scottevanson"}},{"@type":"Answer","text":"
Ok here it is but without the usage, I can’t test that part unfortunately though I would assume it could be achieved with Get-MailboxStatistics<\/p>\n
$DataPath = “C:\\Archiving-Quotas.csv”<\/strong>
\n$Results =@()<\/strong>
\n$Users = Get-Mailbox<\/strong>
\nForEach ($User in $Users)<\/strong>
\n{<\/strong>
\n$Data = Get-Mailbox -Identity $User.Alias<\/strong>
\n$Data | ft Name,Archive<\/em><\/strong>
\nIf ($Data.ArchiveStatus -eq $true)<\/strong>
\n{<\/strong>
\n$Archiving = “Enabled”<\/strong>
\n$Quota = $Data.ArchiveQuota<\/strong>
\n$Warning = $Data.ArchiveWarningQuota<\/strong>
\n$Database = $Data.ArchiveDatabase<\/strong>
\n}<\/strong>
\nElse<\/strong>
\n{<\/strong>
\n$Archiving = “Disabled”<\/strong>
\n$Quota = $Data.ArchiveQuota<\/strong>
\n$Warning = $Data.ArchiveWarningQuota<\/strong>
\n$Database = $Data.ArchiveDatabase<\/strong>
\n}<\/strong>
\n$TableResults = @{<\/strong>
\nArchiving = $Archiving<\/strong>
\nWarning = $Warning<\/strong>
\nQuota = $Quota<\/strong>
\nDatabase = $Database<\/strong>
\nName = $User.Alias<\/strong>
\n}<\/strong>
\n$Results += New-Object psobject -Property $TableResults<\/strong>
\n}<\/strong>
\n$Results | Export-CSV -Path $DataPath<\/strong><\/p>","upvoteCount":1,"datePublished":"2018-11-23T04:51:13.000Z","url":"https://community.spiceworks.com/t/export-archive-mailbox-report/685166/4","author":{"@type":"Person","name":"scottevanson","url":"https://community.spiceworks.com/u/scottevanson"}},{"@type":"Answer","text":"