Grant-CsClientPolicy

 

Topic Last Modified: 2017-05-17

ImportantImportant:
This only applies to Skype for Business Online and not to Skype for Business Server or Lync on-premises deployments.
ImportantImportant:
Please note that if your organization utilizes custom policies, then the UI will no longer correctly reflect the policy values. Once they are implemented they must continue to be managed via PowerShell.

Assigns a client policy to a user or a group of users. Among other things, client policies help determine the features of Skype for Business that are available to users; for example, you might give some users the right to transfer files while denying this right to other users.

Grant-CsClientPolicy -PolicyName <String> [-Identity <UserIdParameter>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-PassThru <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

In Example 1, the client policy SalesPolicy is assigned to the user with the Identity Ken Myer.

Grant-CsClientPolicy -Identity "Ken Myer" -PolicyName SalesPolicy

In Example 2, all the users who belong to the Sales department are assigned the SalesPolicy client policy. The command first uses the Get-CsOnlineUser cmdlet and the LdapFilter parameter to return a collection of all the users who are members of the Sales department. This collection of users is then piped to the Grant-CsClientPolicy cmdlet, which assigns the policy SalesPolicy to each user in the collection.

Get-CsOnlineUser -LDAPFilter "Department=Sales" | Grant-CsClientPolicy -PolicyName SalesPolicy

In Example 3, the client policy RedmondAccountingPolicy is assigned to all the users who meet two criteria: 1) the user must have the job title Accountant; and, 2) the user must work in the city of Redmond. To do this, the command first uses the Get-CsOnlineUser cmdlet and the LdapFilter parameter to return a collection of all the users who work in Redmond and have the job title Accountant. The filter value "(&(Title=Accountant)(l=Redmond))" limits the returned data to users who have the job title Accountant (Title=Accountant) and (&) who work in Redmond (l=Redmond). (The "l" is a lowercase L, and represents the user’s locality.)

The resulting collection is then piped to the Grant-CsClientPolicy cmdlet, which assigns the policy RedmondAccountingPolicy to each user in the collection.

Get-CsOnlineUser -LDAPFilter "(&(Title=Accountant)(l=Redmond))" | Grant-CsClientPolicy -PolicyName RedmondAccountingPolicy

Example 4 assigns the policy AccountingPolicy to all the users who meet one of two criteria: either the user has the job title Accountant or the user has the job title Senior Accountant. To carry out this task, the Get-CsOnlineUser cmdlet and the LdapFilter parameter are used to return a collection of users with the job title Accountant or Senior Accountant. The filter value "(|(Title=Accountant)(Title=Senior Accountant))" limits the returned data to users with the job title Accountant (Title=Accountant) or (|) users with the job title Senior Accountant (Title=Senior Accountant). This filtered collection is then piped to the Grant-CsClientPolicy cmdlet, which assigns the client policy AccountingPolicy to each user in the collection.

Get-CsOnlineUser -LdapFilter "(|(Title=Accountant)(Title=Senior Accountant))" | Grant-CsClientPolicy -PolicyName AccountingPolicy

Skype for Business Online uses client policies to help determine the features and capabilities that are available to users. Client policies are applied each time a user accesses the system, regardless of where the user logs on from and regardless of the type of device the user logs on with. In addition, client policies, like other policies, can readily be targeted to selected groups of users. You can even create a custom policy that gets assigned to a single user.

 

Parameter Required Type Description

PolicyName

Required

System.String

"Name" of the policy to be assigned. The PolicyName is simply the policy Identity minus the policy scope ("tag:"). For example, a policy that has the Identity tag:Redmond has a PolicyName equal to Redmond; a policy with the Identity tag:RedmondConferencingPolicy has a PolicyName equal to RedmondConferencingPolicy.

If you set PolicyName to a null value, then the command will unassign any per-user policy assigned to the user. For example:

Grant-CsClientPolicy -Identity "Ken Myer" -PolicyName $Null

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command.

Identity

Optional

Microsoft.Rtc.Management.AD.UserIdParameter

Indicates the Identity of the user account the policy should be assigned to. User Identities can be specified by using one of the following formats: 1) the user's SIP address; 2) the user's user principal name (UPN); or, 3) the user's Active Directory display name (for example, Ken Myer).

PassThru

Optional

System.Management.Automation.SwitchParameter

If present, causes the cmdlet to pass the user object (or objects) through the Windows PowerShell pipeline. By default, the Grant-CsClientPolicy cmdlet does not pass objects through the pipeline.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Describes what would happen if you executed the command without actually executing the command.

String value or Microsoft.Rtc.Management.ADConnect.Schema.ADUser object. The Grant-CsClientPolicy cmdlet accepts pipelined input of string values representing the Identity of a user account. The cmdlet also accepts pipelined input of user objects.

By default, the Grant-CsClientPolicy cmdlet returns no objects or values. However, if you include the PassThru parameter, the cmdlet will return instances of the Microsoft.Rtc.Management.ADConnect.Schema.OCSUserOrAppContact object.

 
Show: