RMish
RMish

Reputation: 151

Need to send a .csv to Teams using Powershell

I want to send a .csv file to Microsoft Teams channel using Powershell. I have the incoming webhook URI but I am not sure which command should I use to accomplish this. I've tried using the SendTeamsMessage command but couldn't get through. Any help is appreciated. Thank you. And this forum rocks..

Upvotes: 0

Views: 2619

Answers (1)

Geetha Doli
Geetha Doli

Reputation: 31

Please use the below script, it is working

Send-MailMessage -From "[email protected]" -To "channelemailaddress" -Subject "Test123" -SmtpServer "smtp.office365.com" -Credential "[email protected]" -UseSsl -Attachments "E:\scripts\output.csv" 

Please refer the attached document for more info. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7

Upvotes: 3

Related Questions