|
Get-Date | Select-Object Date | convertTo-HTML -head $a -Title "Public Folder Access" | Out-File c:\report.htm
$server = "mailbox server name"
$folder = "\HR"
$a= "<script src=c:\sorttable.js type=text/javascript></script>"
$a = $a + "<style>"
$a = $a + "BODY{background-color:gray;}"
$a = $a + "TABLE.sortable thead {border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:yellow}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:white}"
$a = $a + "</style>"
Get-PublicFolderStatistics -Server $server| Select-Object admindisplayname, creationtime, Lastmodificationtime, itemcount, totalitemsize, servername | where-object {$_.Lastmodificationtime -lt "1/1/2000 12:00:00 AM"} | convertTo-HTML -Body "<H2>Over the last modified date</H2>" | Out-File c:\report.htm -append
Get-PublicFolderStatistics -Server $server| Select-Object admindisplayname, creationtime, Lastmodificationtime, itemcount, totalitemsize, servername | where-object {$_.Lastmodificationtime -gt "1/1/2000 12:00:00 AM"} | convertTo-HTML -Body "<H2>Under the last modified date</H2>" | Out-File c:\report.htm -append
Get-PublicFolder -Recurse -Server $server -Identity $folder | Select-Object Name, MailEnabled, HasSubFolders, IssueWarningQuota, MaxItemSize | convertTo-HTML -head $a -Title "Public Folder Access" -Body "<H2>Public Folder Information</H2>" | Out-File c:\report.htm -append
(Get-Content C:\report.htm) | Foreach-Object {$_ -replace "<table>", "<table class =sortable>"} | Set-Content C:\report.htm
(Get-Content C:\report.htm) | Foreach-Object {if($_ -like "*TotalItemSize*"){$_ -replace "t</th><th>", "t</th><th class=sorttable_numeric>"} else{$_}} | Set-Content C:\report.htm
(Get-Content C:\report.htm) | Foreach-Object {if($_ -like "*ItemCount*"){$_ -replace "ModificationTime</th><th>", "ModificationTime</th><th class=sorttable_numeric>"} else{$_}} | Set-Content C:\report.htm
(Get-Content C:\report.htm) | Foreach-Object {if($_ -like "*TotalItemSize*"){$_ -replace "count</th><th>", "count</th><th class=sorttable_numeric>"} else{$_}} | Set-Content C:\report.htm
|