Forum Discussion
dmarquesgn
Mar 17, 2023Iron Contributor
Get Teams chat ID
Hi, I'm developing some alarmistic in Powershell, which to this day, sends the alerts over email. But I would like to send the alarmistic also to a Teams chat (not a group). I've found a script tha...
- Mar 18, 2023You have to connect like this
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All,Chat.Read,Chat.ReadWrite,ChatMember.ReadWrite,Chat.ReadBasic"
Mar 17, 2023
You can get a list of chats using Get-MgUserChat https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.teams/get-mguserchat?view=graph-powershell-1.0
- dmarquesgnMar 18, 2023Iron ContributorThanks for the reference. But when I run it, I've got an error: "Get-MgUserChat : Missing scope permissions on the request. API requires one of 'Chat.ReadBasic, Chat.Read, Chat.ReadWrite'. Scopes on the request 'AuditLog.Read.All, openid, profile, User.Read, User.Read.All, email'"
How can I set this scope on Powershell? Never done this before.- Mar 18, 2023You have to connect like this
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All,Chat.Read,Chat.ReadWrite,ChatMember.ReadWrite,Chat.ReadBasic"- dmarquesgnMar 21, 2023Iron Contributor
Hi, thanks for the reference, never used it like that, but worked like a charm.