|
| 1 | +--- |
| 2 | +external help file: Microsoft.TeamsCmdlets.PowerShell.Custom.dll-Help.xml |
| 3 | +Module Name: MicrosoftTeams |
| 4 | +online version: |
| 5 | +schema: 2.0.0 |
| 6 | +author: tomkau |
| 7 | +ms.author: tomkau |
| 8 | +ms.reviewer: |
| 9 | +--- |
| 10 | + |
| 11 | +# New-CsGroupPolicyAssignment |
| 12 | + |
| 13 | +## SYNOPSIS |
| 14 | +This cmdlet is used to assign a policy to a group. |
| 15 | + |
| 16 | +## SYNTAX |
| 17 | + |
| 18 | +``` |
| 19 | +New-CsGroupPolicyAssignment -GroupId <String> -PolicyType <String> -PolicyName <String> [-Priority <Int>] |
| 20 | +``` |
| 21 | + |
| 22 | +## DESCRIPTION |
| 23 | +This cmdlet will assign a policy to a group. The group can be specified by object id or by email/SIP address. |
| 24 | + |
| 25 | +The priority is used to determine which policy a user should inherit as their effective policy if they are a member of two or more groups that each have a policy of the same type assigned (and the user has not been directly assigned a policy of the same type). |
| 26 | + |
| 27 | +It’s helpful to think of priority as determining the position of each policy assignment in an ordered list, from highest priority to lowest priority. In fact, priority can be specified as any number, but these are converted into sequential values 1, 2, 3, etc. with 1 being the highest priority. When assigning a policy to a group, set the priority to be the position in the list where you want the new group policy assignment to be. If a priority is not specified, the policy assignment will be given the lowest priority. |
| 28 | + |
| 29 | +## EXAMPLES |
| 30 | + |
| 31 | +### Example 1 |
| 32 | +In this example, a policy is assigned to a group specified by object id. |
| 33 | + |
| 34 | +``` |
| 35 | +New-CsGroupPolicyAssignment -GroupId d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 -PolicyType TeamsMeetingPolicy -PolicyName AllOn -Priority 1 |
| 36 | +
|
| 37 | +Get-CsGroupPolicyAssignment -PolicyType TeamsMeetingPolicy |
| 38 | +
|
| 39 | +GroupId PolicyName PolicyType Priority |
| 40 | +------- ---------- ---------- -------- |
| 41 | +d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 Host:AllOn TeamsMeetingPolicy 1 |
| 42 | +``` |
| 43 | + |
| 44 | +### Example 2 |
| 45 | +In this example, a policy is assigned to a group specified by email/SIP address. The priority is not specified so it will be set to the lowest priority for the given policy type. |
| 46 | + |
| 47 | +``` |
| 48 | +New-CsGroupPolicyAssignment -GroupId salesdepartment@contoso.com -PolicyType TeamsMeetingPolicy -PolicyName Kiosk |
| 49 | +
|
| 50 | +Get-CsGroupPolicyAssignment -PolicyType TeamsMeetingPolicy |
| 51 | +
|
| 52 | +GroupId PolicyName PolicyType Priority |
| 53 | +------- ---------- ---------- -------- |
| 54 | +d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 Host:AllOn TeamsMeetingPolicy 1 |
| 55 | +566b8d39-5c5c-4aaa-bc07-4f36278a1b38 Host:Kiosk TeamsMeetingPolicy 2 |
| 56 | +``` |
| 57 | + |
| 58 | +### Example 3 |
| 59 | +In this example, the policy assignment priority is set to 2. The current priority 2 policy assignment of the same type will be updated to priority 3. |
| 60 | + |
| 61 | +``` |
| 62 | +Get-CsGroupPolicyAssignment -PolicyType TeamsMeetingPolicy |
| 63 | +
|
| 64 | +GroupId PolicyName PolicyType Priority |
| 65 | +------- ---------- ---------- -------- |
| 66 | +d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 Host:AllOn TeamsMeetingPolicy 1 |
| 67 | +566b8d39-5c5c-4aaa-bc07-4f36278a1b38 Host:Kiosk TeamsMeetingPolicy 2 |
| 68 | +
|
| 69 | +New-CsGroupPolicyAssignment -GroupId e050ce51-54bc-45b7-b3e6-c00343d31274 -PolicyType TeamsMeetingpolicy -PolicyName AllOff -Priority 2 |
| 70 | +
|
| 71 | +Get-CsGroupPolicyAssignment |
| 72 | +
|
| 73 | +GroupId PolicyName PolicyType Priority |
| 74 | +------- ---------- ---------- -------- |
| 75 | +d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 Host:AllOn TeamsMeetingPolicy 1 |
| 76 | +e050ce51-54bc-45b7-b3e6-c00343d31274 Host:AllOff TeamsMeetingPolicy 2 |
| 77 | +566b8d39-5c5c-4aaa-bc07-4f36278a1b38 Host:Kiosk TeamsMeetingPolicy 3 |
| 78 | +``` |
| 79 | + |
| 80 | +## PARAMETERS |
| 81 | + |
| 82 | +### -GroupId |
| 83 | +The ID of a batch policy assignment operation. |
| 84 | + |
| 85 | +```yaml |
| 86 | +Type: String |
| 87 | +Parameter Sets: |
| 88 | +Aliases: |
| 89 | + |
| 90 | +Required: True |
| 91 | +Position: Named |
| 92 | +Default value: None |
| 93 | +Accept pipeline input: False |
| 94 | +Accept wildcard characters: False |
| 95 | +``` |
| 96 | +
|
| 97 | +### -PolicyType |
| 98 | +The type of the policy to be assigned. |
| 99 | +
|
| 100 | +```yaml |
| 101 | +Type: String |
| 102 | +Parameter Sets: |
| 103 | +Aliases: |
| 104 | + |
| 105 | +Required: True |
| 106 | +Position: Named |
| 107 | +Default value: None |
| 108 | +Accept pipeline input: False |
| 109 | +Accept wildcard characters: False |
| 110 | +``` |
| 111 | +
|
| 112 | +### -PolicyName |
| 113 | +The name of the policy to be assigned. |
| 114 | +
|
| 115 | +```yaml |
| 116 | +Type: String |
| 117 | +Parameter Sets: |
| 118 | +Aliases: |
| 119 | + |
| 120 | +Required: True |
| 121 | +Position: Named |
| 122 | +Default value: None |
| 123 | +Accept pipeline input: False |
| 124 | +Accept wildcard characters: False |
| 125 | +``` |
| 126 | +
|
| 127 | +### -Priority |
| 128 | +The priority of the policy assignment, relative to other group policy assignments for the same policy type. |
| 129 | +
|
| 130 | +```yaml |
| 131 | +Type: String |
| 132 | +Parameter Sets: |
| 133 | +Aliases: |
| 134 | + |
| 135 | +Required: False |
| 136 | +Position: Named |
| 137 | +Default value: None |
| 138 | +Accept pipeline input: False |
| 139 | +Accept wildcard characters: False |
| 140 | +``` |
| 141 | +
|
| 142 | +### CommonParameters |
| 143 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. |
| 144 | +For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216). |
| 145 | +
|
| 146 | +## INPUTS |
| 147 | +
|
| 148 | +## OUTPUTS |
| 149 | +
|
| 150 | +### OperationId |
| 151 | +The ID of the operation that can be used with the Get-CsBatchPolicyAssignmentOperation cmdlet to get the status of the operation. |
| 152 | +
|
| 153 | +## NOTES |
| 154 | +
|
| 155 | +## RELATED LINKS |
| 156 | +
|
| 157 | +[Get-CsGroupPolicyAssignment]() |
| 158 | +
|
| 159 | +[Set-CsGroupPolicyAssignment]() |
| 160 | +
|
| 161 | +[Remove-CsGroupPolicyAssignment]() |
| 162 | +
|
0 commit comments