Teams PowerShell - Assign an app permission policy and app setup policy to AD group members

 


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"
}

Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.