Forum Discussion
Mark All Messages As Read
m_g_danish Here is the PowerShell script to mark your chats as read in a click!
- RickKastenLMMar 08, 2023Copper Contributor
SanthoshB1 This script requires an admin account to Teams
- SanthoshB1Mar 13, 2023Bronze Contributor
RickKastenLM This script uses Connect-MgGraph -Scopes "Chat.ReadWrite" ,"User.Read". These scopes does not require admin consent (see screenshots below). Please check with your admin in case it is blocked in your tenant.
- GunjanTyagiMar 29, 2023Copper Contributor
SanthoshB1
can you please help with the error, I am providing the actual user UPN in the userUPN parameter as instructed in the script, while executing the script given in the link you shared it says:
Invoke-MgMarkChatReadForUser : Id of the user must be specified
At line:33 char:13
+ Invoke-MgMarkChatReadForUser -ChatId $chat.Id -BodyParame ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ ChatId = 19:a...onJsonSchema1 }:<>f__AnonymousType0`2) [Invoke-MgMarkChatReadForUser_Mark], RestException`1
+ FullyQualifiedErrorId : BadRequest,Microsoft.Graph.PowerShell.Cmdlets.InvokeMgMarkChatReadForUser_Mark
Invoke-MgMarkChatReadForUser : Id of the user must be specified
At line:33 char:13
+ Invoke-MgMarkChatReadForUser -ChatId $chat.Id -BodyParame ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ ChatId = 19:7...onJsonSchema1 }:<>f__AnonymousType0`2) [Invoke-MgMarkChatReadForUser_Mark], RestException`1
+ FullyQualifiedErrorId : BadRequest,Microsoft.Graph.PowerShell.Cmdlets.InvokeMgMarkChatReadForUser_Mark
- gbrittonFeb 24, 2023Copper Contributor
SanthoshB1 where did you get Microsoft.Graph.Teams?
- ms_dbaMar 08, 2023Brass Contributor
Look here for MsGraph Teams module:
https://www.powershellgallery.com/packages/Microsoft.Graph.Teams/1.23.0The link provided does not mark items in the Feed as read.
https://blog.apps4.pro/mark-teams-chat-messages-as-read
MsGraph Teams module 1.9.2 did not work as documented in the link above. 1.23.0 worked.