Jump to content

Recommended Posts

Posted

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

$SMTPClient.Send($SMTPMessage)

 

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 ?

Mike

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...