首页 > 解决方案 > 需要使用 Powershell 向 Teams 发送 .csv

问题描述

我想使用 Powershell 将 .csv 文件发送到 Microsoft Teams 频道。我有传入的 webhook URI,但我不确定应该使用哪个命令来完成此操作。我已经尝试使用该SendTeamsMessage命令,但无法通过。任何帮助表示赞赏。谢谢你。这个论坛摇滚..

标签: powershellmicrosoft-teams

解决方案


请使用以下脚本,它正在工作

Send-MailMessage -From "User1@contoso.com" -To "channelemailaddress" -Subject "Test123" -SmtpServer "smtp.office365.com" -Credential "User1@contoso.com" -UseSsl -Attachments "E:\scripts\output.csv" 

有关更多信息,请参阅附件。https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7


推荐阅读