PSScript error message Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo


Exchange Powershell command error message

 Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo

On executing the below powershell on exporting to html file it will result error message in the html file

Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | ft Name, DatabaseSize -Autosize | ConvertTo-HTML -head $a | Out-File C:\Temp\DBFileSize.htm

Solution:

On removing the format-table and -autosize from the powershell command the error message disappered. Finally the command changed as follows,

Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Select-Object Name, DatabaseSize, AvailableNewMailboxSpace | ConvertTo-HTML | Out-File C:\Temp\DBFileSize.htm

Complete Script: Save the file as filename.ps1 and execute from the exchange powershell.

$a = “<style>”
$a = $a + “BODY{background-color:peachpuff;}”
$a = $a + “TABLE{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:thistle}”
$a = $a + “TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}”
$a = $a + “</style>”
Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Select-Object Name, DatabaseSize, AvailableNewMailboxSpace, Mounted,
BackupInProgress | ConvertTo-HTML -head $a | Out-File C:\Temp\DBFileSize.htm
Invoke-Expression C:\Temp\DBFileSize.htm

Advertisements

About Raji Subramanian

Nothing great to say about me...Just want to share my knowledge for others that will be useful at any moment of time when they stuck in critical issue....
This entry was posted in Commands, Exchange Server, OWA 2013, Script and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s