Forum Discussion
SeanS
Feb 22, 2022Copper Contributor
Mark All Messages As Read
I noticed that some members of my teams have a lot of bold text on their screen indicating unread messages. We are all busy and sometimes we lose track of things and unread messages build up. Users t...
m_g_danish
Jan 03, 2023Copper Contributor
I agree, this is annoying. It's not an ideal solution, but the best workaround I've found so far is to use the down arrow key to scroll down through each item in my Activity Feed and mark them as read by pressing Enter. That at least cuts down the time spent to several seconds, and the key presses can be automated via a macro or Power Automate Desktop flow. It doesn't seem to matter how long you spend on each unread item, so long as the sequence of key presses is some multiple of down+Enter.
SanthoshB1
Feb 15, 2023Bronze Contributor
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, 2023Copper 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.