title: PowerShell Microsoft Teams: Get a Team's "GroupID" & assign it to a variable
body: <p>I have a simple Powershell script to create a Microsoft team, channels, users, and then to associate the users with the channels.  I'm currently prompting user to enter team name, and then to copy past the GroupID, as I cannot figure out how to get just the group ID.  Is there any way I can just get the &quot;GroupID&quot; so I can assign it to a variable and not force the user to copy-paste?</p>
  <pre><code>Connect-MicrosoftTeams
  $NewTeamName = Read-Host -Prompt 'Name of new Team'
  New-Team -DisplayName $NewTeamName
  Get-Team -DisplayName $NewTeamName
  $GroupId = Read-Host -Prompt 'Copy and past the GroupID above'
  Import-csv createTeamChannels.csv | foreach{New-TeamChannel -GroupId $GroupId -DisplayName $_.cname -MembershipType Private}
  ...
  </code></pre>