How to Assign a custom app setup policy to users in a group using Powershell?
Assigning a custom app setup policy to users in a group
1.Install-Module -Name AzureAD
/*Skype for Business Online, Windows PowerShell Module can be downloaded and installed */
Import-Module SkypeOnlineConnector
$userCredential = Get-Credential $sfbSession = New-CsOnlineSession -Credential $userCredential Import-PSSession $sfbSession
connect-AzureAD -Credential $userCredential
$group = Get-AzureADGroup -SearchString "TeamsApp"
$members = Get-AzureADGroupMember -ObjectId $group.ObjectId -All $true | Where-Object {$_.ObjectType -eq "User"}
$members | ForEach-Object { Grant-CsTeamsAppSetupPolicy -PolicyName "Teams App Policy Test" -Identity $_.UserPrincipalName}
Installation file for Skype for Business Online, Windows PowerShell Module https://www.microsoft.com/en-us/download/details.aspx?id=39366
Reference
https://docs.microsoft.com/en-us/microsoftteams/teams-app-setup-policies
https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-overview
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.