简体   繁体   中英

How to Assign a custom app setup policy to users in a group using Powershell?

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

https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-all-office-365-services-in-a-single-windows-powershell-window

https://docs.microsoft.com/en-us/skypeforbusiness/set-up-your-computer-for-windows-powershell/set-up-your-computer-for-windows-powershell

https://docs.microsoft.com/en-us/office365/enterprise/powershell/manage-skype-for-business-online-with-office-365-powershell

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM