Coding Thread, Powershell Help in Coding and Web Development; I am running the following script on a scheduled task to check the replication status on our Exchange server(s)
1st August 2009, 04:25 PM #1
- Rep Power
I am running the following script on a scheduled task to check the replication status on our Exchange server(s)
$FromAddress= "HIDDEN FOR OBVIOUS REASONS"
$ToAddress= "HIDDEN FOR OBVIOUS REASONS"
$MessageSubject= "Exchange Replication Report"
$MessageBody= get-content ./filename.txt
$SendingServer= "HIDDEN FOR OBVIOUS REASONS"
Get-StorageGroupCopyStatus -StandbyMachine glblade3 -server wmexchserver1 | select-object identity, summarycopystatus | format-table -wrap | Out-File filename.txt
$SMTPMessage= New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
In short it runs the test "Get-StorageGroupCopyStatus", outputs to a text file and then emails the contents of the file.
Problem is the formatting on the contents is terrible, the text is cut off in places and it is plain text so it doesn't know when to do a carriage return, this makes it horrible on the eyes.
Any idea's ?
IDG Tech News
By jamesb in forum Scripts
Last Post: 21st July 2009, 10:49 AM
By imiddleton25 in forum Windows
Last Post: 2nd February 2009, 09:17 AM
Last Post: 26th November 2008, 12:54 AM
By ezzauk in forum Windows
Last Post: 25th September 2008, 02:02 PM
By tarquel in forum Downloads
Last Post: 26th March 2007, 08:32 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)