Teams PowerShell (contd.)

I had to leave yesterday so stopped my previous post abruptly. In my previous post I had mentioned that after an account migration the user couldn’t see any of their teams so I changed their role from member/owner to owner/member and back, and that fixed the issue. However they couldn’t see any of the channels they previously had access to.

I prepared a report of all the channels in the teams the user is a member of via this snippet:

Sent the CSV to the user so they can select the ones they were a member of. The channels are in a single column with semi-colons separating them.

Armed with that output I ran the following to add the user back to the channels:

The “NONE” and length 0 checks were necessary to ignore remarks from the user in the CSV file.

In this case I went with adding the user as a member, but I could have used the -Role Owner switch to add as an owner.

I have more migrations to do, so I figured I should make a list of all teams a user is member of, find out the private channels, and if the user is in any of them then capture the info. Here’s what I came up with: