This is a PowerShell script I wrote to take an Azure AD group and assign the members a Teams App Permission policy and a Teams App Setup Policy. First, look up the group's Object ID in Azure AD, and then replace it in the script below.
You will also need to replace the policy names with the policies you want to assign.
Connect-MicrosoftTeams
$GroupObjectId="00000000-0000-0000-0000-000000000000"
$GroupMembers = Get-AzureADGroupMember -ObjectId $GroupObjectId -All $true | select UserPrincipalName
$GroupMembers | ForEach {
Grant-CsTeamsAppPermissionPolicy -Identity $_.UserPrincipalName -PolicyName "App Permission Policy Name"
Grant-CsTeamsAppSetupPolicy -Identity $_.UserPrincipalName -PolicyName "App Setup Policy Name"
}
$GroupMembers = Get-AzureADGroupMember -ObjectId $GroupObjectId -All $true | select UserPrincipalName
Grant-CsTeamsAppPermissionPolicy -Identity $_.UserPrincipalName -PolicyName "App Permission Policy Name"
Grant-CsTeamsAppSetupPolicy -Identity $_.UserPrincipalName -PolicyName "App Setup Policy Name"
}
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.