Reporting on Groups non-public Chat Exercise utilizing the TeamChat Folder in Change

Reporting on Groups non-public Chat Exercise utilizing the TeamChat Folder in Change

This can be a Segway from my final publish on Reporting on Skype for Enterprise Messaging Exercise utilizing the Dialog Historical past Folder in Change .On this Put up I will be trying on the Personal chat messages from Microsoft Groups that get saved in a hidden folder known as TeamChat (see this publish for the best way to get that folder in EWS) beneath the dialog Historical past Folder as a part of the compliance course of for Groups.  As Groups remains to be a piece in course of plenty of these compliance properties have modified since my first publish about getting this folder and looking out on the historical past of even the restricted dataset in my mailboxes there’s plenty of fluidity within the compliance info that’s being added (so its a little bit little bit of a canine breakfast by way of knowledge once you return a variety of months). The compliance properties themselves get added when the substrate course of within the cloud copies the Chat Message from the skypespaces backend to the Mailbox.  To offer you a visible illustration on what these properties seem like you should utilize a MAPI Editor 

In contrast to Skype the place there was one message that may symbolize a number of messages in a Chat Thread, with Groups there’s a one to 1 foundation for every non-public Chat message in a Thread. All of the attention-grabbing meta-information that’s wanted for reporting is held within the above Prolonged properties. Take for example the ToSkypeInternalIds property which comprises the checklist of the recipients for Personal Chats saved in a Multivalued string property. (this info additionally will get saved within the Recipient Assortment of the Message in a resolved format)
As an alternative of SIP addresses like Skype, (for chat anyway) Groups has its personal format which comprises the AzureAd guid of the consumer (or Visitor). If you’d like  to resolve this again into an EmailAddress or UPN the Graph API can be utilized to do that eg if I take a Groups tackle
utilizing a easy Break up to get simply the guid portion of this string you may then do a easy Relaxation Get to get the consumer info so long as you’ve gotten an underlying Token to make use of within the Graph API  eg
$GUID = “8:orgid:fb25746f-fa0c-4f01-b815-a7f7b878786f”.Break up(‘:’)[2] “‘” + $GUID + “‘)”
I’ve put collectively a script that first will get the TeamChat folder utilizing EWS then enumerates the messages in that folder for a specific day timeframe and utilizing a variety of the prolonged properties from the primary display shot to construct some log entries that may then be summarised into some stories. 
EWS Meet Graph

As a result of EWS does not have a manner of resolving the Guids from the From and To Tackle properties in Groups. I’ve built-in a little bit of Microsoft Graph Code to the do the decision. As a result of by default this script makes use of oAuth we are able to take the Refresh Token from the primary auth used to get into EWS after which get one other token for the GraphEndpoint while not having to re-prompt for authentication so this all suits collectively properly.
So by default once you run the script you’ll get flat log entries again like
Or you may Group the threads collectively (based mostly on the ThreadId) utilizing the -GroupThreads Change
Just like the Dialog Historical past script I’ve three base stories that look one thing like this in HTML
To make use of these Reporting choices
Get-TeamsIMLog -MailboxName [email protected] -Days 30 -reportbyDate 
-htmlReport | Out-file c:temp30dayreport.html

in order for you the identical report in csv use

Get-TeamsIMLog -MailboxName [email protected] -Days 30
 -reportbyDate | ConvertTo-Csv -NoTypeInformation -path c:temp30dayreport.csv

To report the highest senders that despatched this Mailbox in Direct Chats

Get-TeamsIMLog -MailboxName [email protected] -Days 30
To report the highest recipients of IM’s

Get-TeamsIMLog -MailboxName [email protected] -Days 30
I’ve put the code for this script up on Git Hub right here 

Rent me – If you need to do one thing much like this or the rest you see on my weblog I am at present out there to assist with any Workplace365,Microsoft Groups, Change or Energetic Listing associated improvement work or scripting, please contact me at [email protected](nothing too huge or small).

Related Posts

Leave a Reply