Attachment must be a full path, and it must be quoted.
e.g.
$Attachment = New-Object Net.Mail.Attachment("mailb
You know you can use a CSV file for this (opens nicely in Excel) or HTML if you prefer to have it in the message body? Both look better than redirecting the output from Format-Table to a file in my opinion.
Chris
Main Topics
Browse All Topics





by: chandru_solPosted on 2009-10-08 at 22:27:26ID: 25532526
Hi,
articles_t utorials/e xchange-se rver- 2007/ management -administr ation/gett ing-mailbo x-statisti cs- exchang e-2007.htm l
I think you are using the script from this link
http://www.msexchange.org/
Can you make sure that the path is specified correctly for the the below
PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1" -Command "./sendstats.ps1"
Here you can see that PowerShell is run and loads the Exchange console file, found on the C: drive in this example. Obviously you may need to change this depending on which drive Exchange 2007 has been installed onto. The Command parameter is used to identify the script that we want to run, namely sendstats.ps1.