Archive MS Teams Groups - Automation

Ramki 816 Reputation points
2020-11-05T04:58:31.223+00:00

Hello Teams Master,

Iam looking for the script / Graph API to archive the MS teams groups who left the organization. i believe the below process have to follow to achieve this.

  1. i need to find the list of MS Teams groups owned by specific user.
  2. Then need to collect the list of gruoups and archive them
  3. This needs to be done by graph API / Powershell script.

Could you please someone helped. i have a script to collect the list of MS Teams and their ownners , however am looking for someting below

Enter the user name to display the list belongs to : abc@cloudmonkeys.xyz

and the result should give the list of MS Teams groups who owned by the specific user "abc@cloudmonkeys.xyz"

and finally it groups should be archive set-teamarchivedstate.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,948 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ramki 816 Reputation points
    2020-11-10T11:50:23.457+00:00

    Get-UnifiedGroup | Where-Object {$_.managedby -eq "ann.parker"}

    and

    Get-UnifiedGroup | Where-Object {$.managedby -eq "ann.parker" -and $.welcomemessageEnabled -ne "True"}

    The above command will fulfil this requirement

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Vasil Michev 103.7K Reputation points MVP
    2020-11-05T06:41:47.197+00:00
    0 comments No comments

  2. JimmyYang-MSFT 51,951 Reputation points Microsoft Vendor
    2020-11-05T07:49:38.3+00:00

    Hi @Alig69 ,

    According your description, your issue is related to development, which we do not support. I found a blog shows the example of how to achieve Teams by using API for your reference:

    https://www.c-sharpcorner.com/article/how-to-restore-ms-teams-using-graph-api-in-powershell/


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.