Hi @Chapter7-2723,
thank you for your response. I've adjusted the PS script a little bit:
# Set the path to the CSV file containing the Teams names
$csvPath = "C:\Temp\TeamsGroupID.csv"
# Import the Teams names from the CSV file
$teams = Import-Csv $csvPath
# Create an empty array to store the results
$results = @()
# Loop through each Team and get the Team ID
foreach ($team in $teams) {
$teamName = $team.DisplayName
$teamId = (Get-Team -DisplayName $teamName).GroupId
$results += [PSCustomObject]@{
TeamName = $teamName
TeamId = $teamId
}
}
# Export the results to a CSV file
$results | Export-Csv "C:\Temp\TeamsGroupIDExport.csv" -NoTypeInformation
be sure to adjust your path for import and export.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".