Get-TeamsMembership.ps1


<#PSScriptInfo
 
.VERSION 0.25
 
.GUID 5afc96b9-693c-430d-a0e6-773a20377212
 
.AUTHOR Paul Robichaux
 
COMPANYNAME Quadrotech Solutions
 
.COPYRIGHT (c) 2018 Quadrotech Solutions Inc.
 
.TAGS Teams
 
.LICENSEURI
http://creativecommons.org/licenses/by-nc/4.0/
 
 
.RELEASENOTES
07-July-2018: 1.0. Initial release.
 
 
 
#>


<#
 
.DESCRIPTION
This script will show which Teams objects the specified user is a member or owner of.
It can optionally clone membership from one user to another, so the target user has the same Teams memberships as the source user.
    
If you're not already connected to an Exchange Online PowerShell session, the script will attempt to connect you. It requires the Connect-ExOPSSession cmdlet, which means you need the Exchange Online Remote PowerShell module.
 
 
#>
 
<#
.Synopsis
Get-TeamsMembership
 
See and manage Microsoft Teams membership for the selected user.
 
Paul Robichaux
Quadrotech Solutions
paul.robichaux@quadro.tech
 
 
    THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
    RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
 
    Version 1.0, July 6th, 2018
     
.LINK
http://www.quadrotech-it.com
    
.Parameter $Identity
    Mandatory: User whose Teams membership you want to see. May be a display name or primary SMTP address.
    You may also be able to use the UPN if it matches the primary SMTP address.
.Parameter $Credential
    Optional PSCredential object to use when connecting to the service
.Parameter $TargetUser
    Optional: specify the UPN or primary SMTP of the user who you want to clone the source user's Teams membership or ownership to.
.Parameter $Clone
    Optional switch indicating that you want to clone membership from the source user to the target.
.Parameter $CloneOwner
    Optional switch indicating that you want to add the target user as an owner of any Team that the source user is a member of.
.Parameter $WhatIf
    Seriously, y'all know what this does.
.Example
    .\Get-TeamsMembership.ps1 -Identity paul.robichaux@quadrotech-it.com
.Example
    .\Get-TeamsMembership.ps1 -Identity paul.robichaux@quadrotech-it.com -TargetUser New.Employee@quadro.tech -Clone -WhatIf
#>