Powershell command to export ALL private Teams memberships, including private Channel memberships

%3CLINGO-SUB%20id%3D%22lingo-sub-2965813%22%20slang%3D%22en-US%22%3EPowershell%20command%20to%20export%20ALL%20private%20Teams%20memberships%2C%20including%20private%20Channel%20memberships%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2965813%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20is%20currently%20a%20major%20issue%20that%20Microsoft%20is%20not%20saying%20is%20a%20bug.%26nbsp%3B%20When%20a%20user%20is%20soft-deleted%20(what%20happens%20when%20we%20disconnect%20that%20user%20from%20the%20on-premise%20AD%20to%20force%20the%20cloud-only%20conversion)%20they%20are%20soft-deleted%20in%20O365.%26nbsp%3B%20The%20restore%20works%20great%2C%20however%2C%20Teams%20does%20not%20work%20afterwards..%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20the%20account%20is%20restored%2C%20all%20the%20licenses%20are%20retained%2C%20all%20the%20email%2C%20security%2C%20private%20teams%20memberships%20are%20also%20restored%2C%20however%2C%20the%20private%20channel%20memberships%20are%20permanently%20removed%20and%20cannot%20be%20recovered.%26nbsp%3B%20The%20only%20way%20to%20get%20the%20access%20back%20is%20to%20go%20into%20Teams%20Admin%20Centre%2C%20open%20each%20Team%2FChannel%20combo%20and%20re-add%20the%20user.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20happens%20if%20you%20don't%20actually%20know%20what%20private%20channel%20they%20are%20members%20of%20and%20what%20that%20membership%20is%20(member%2Fowner)%3F%26nbsp%3B%20You're%20SOL.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20many%20powershell%20scripts%20but%20they%20won't%20show%20me%20ALL%20private%20teams%20with%20all%20private%20channel%20memberships%20for%20all%20teams%2Fchannels%2Fusers.%26nbsp%3B%20I%20would%20nave%20to%20run%20it%20for%20each%20team%2Fchannel%20name%20combo%20and%20we%20have%20many.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20have%20a%20good%20script%20to%20use%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2965813%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdministrator%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2967401%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20command%20to%20export%20ALL%20private%20Teams%20memberships%2C%20including%20private%20Channel%20membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2967401%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F143000%22%20target%3D%22_blank%22%3E%40Mercedes%20Green%3C%2FA%3E%26nbsp%3B%20%26nbsp%3BLet's%20ask%20some%20of%20our%20super-user%20MVPs%3A%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F588790%22%20target%3D%22_blank%22%3E%40ChristianJBergstrom%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F72542%22%20target%3D%22_blank%22%3E%40adam%20deltinger%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F169605%22%20target%3D%22_blank%22%3E%40Christopher%20Hoard%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9476%22%20target%3D%22_blank%22%3E%40Linus%20Cansby%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F178440%22%20target%3D%22_blank%22%3E%40Steven%20Collier%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F869%22%20target%3D%22_blank%22%3E%40Chris%20Webb%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2998278%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20command%20to%20export%20ALL%20private%20Teams%20memberships%2C%20including%20private%20Channel%20membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2998278%22%20slang%3D%22en-US%22%3EI%20was%20able%20to%20get%20a%20manager%20to%20speak%20to%20me%20about%20this%20issue.%20They%20have%20acknowledged%20the%20issue%20but%20are%20now%20saying%20it's%20supposed%20to%20happen%20and%20why%20I%20can't%20%22get%20give%20their%20memberships%20back%22%20as%20if%20that's%20such%20an%20easy%20endeavor.%20When%20I%20asked%20him%20how%20an%20admin%20is%20supposed%20to%20know%20every%20single%20Team%20(private)%20and%20Team%20Channels%20(private)%20and%20all%20their%20memberships%20and%20membership%20types%2C%20he%20actually%20suggested%20to%20me%20as%20solution%3A%20Create%20a%20spreadsheet%20and%20manually%20keep%20track%20of%20all%20the%20memberships.%20I'm%20not%20sure%20how%20I%20would%20even%20be%20able%20to%20do%20this%20since%20I%20have%20no%20clue%20when%20new%20channels%20are%20created%2C%20or%20new%20members%20added%2C%20so%20I%20guess%20he%20thinks%20I%20would%20have%20to%20look%20through%20every%20single%20one%20manually%20in%20the%20Teams%20Admin%20Centre.%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20is%20Microsoft%20support%20in%202021.%20Keep%20a%20manual%20list%20because%20you'll%20lose%20your%20data.%3C%2FLINGO-BODY%3E
Regular Contributor

There is currently a major issue that Microsoft is not saying is a bug.  When a user is soft-deleted (what happens when we disconnect that user from the on-premise AD to force the cloud-only conversion) they are soft-deleted in O365.  The restore works great, however, Teams does not work afterwards..

 

When the account is restored, all the licenses are retained, all the email, security, private teams memberships are also restored, however, the private channel memberships are permanently removed and cannot be recovered.  The only way to get the access back is to go into Teams Admin Centre, open each Team/Channel combo and re-add the user.

 

What happens if you don't actually know what private channel they are members of and what that membership is (member/owner)?  You're SOL.  

 

I've tried many powershell scripts but they won't show me ALL private teams with all private channel memberships for all teams/channels/users.  I would nave to run it for each team/channel name combo and we have many.  

 

Anyone have a good script to use?

3 Replies

I was able to get a manager to speak to me about this issue. They have acknowledged the issue but are now saying it's supposed to happen and why I can't "just add their memberships back" as if that's such an easy endeavor. When I asked him how an admin is supposed to know every single Team (private) and Team Channels (private) and all their memberships and membership types, he actually suggested to me as solution: Create a spreadsheet and manually keep track of all the memberships. I'm not sure how I would even be able to do this since I have no clue when new channels are created, or new members added, so I guess he thinks I would have to look through every single one manually in the Teams Admin Centre.

This is Microsoft support in 2021. Keep a manual list because you'll lose your data.

I'm not giving up on this issue as it's too important to our users to lose all of their channel memberships. I spoke with a Team Lead for O365 Management and this person told me I should "ask the user what memberships they had" so that I could manually add them back. When you have 20-50+ Teams/Channels depending on the user, they are supposed to have everything listed somewhere to give me so I can manually add them back? I can't even get anyone from Microsoft to give money to to PAY for better support.