got what i want i think...
$FromAddress = "senderemail"
$ToAddress = "recipientemail"
$MessageSubject = "messagesubject"
$MessageBody = "messagebody"
$SendingServer = "smtpserver"
get-storagegroupcopystatus -identity "EXCH1\SG1" -StandbyMachine EXCH2 | Select Identity,SummaryCopyStatus,LastInspectedLogTime | Out-File filename.txt
get-storagegroupcopystatus -identity "EXCH2\First Storage Group" -StandbyMachine EXCH1 |Select Identity,SummaryCopyStatus,LastInspectedLogTime | Out-File filename.txt -append
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress,
$MessageSubject, $MessageBody
$Attachment = New-Object Net.Mail.Attachment("./filename.txt")
$SMTPMessage.Attachments.Add($Attachment)
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
$SMTPClient.Send($SMTPMessage)
results is below
Identity SummaryCopyStatus LastInspectedLogTime
-------- ----------------- --------------------
EXCH1\SG1 Healthy
Identity SummaryCopyStatus LastInspectedLogTime
-------- ----------------- --------------------
EXCH2\SG1 Healthy
thanks for your help. i also got some of it from sendmailboxstatus script which i got from another website i think (credit to them)
i think there are more ways to improve the output...