[This is preliminary documentation and is subject to change. Blank topics are included as placeholders.]

Grants a per-user presence policy to a user or group of users.

Syntax

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

Parameters

Parameter Required Type Description

Identity

Required

Indicates the Identity of the user account to be assigned the presence policy. User Identities can be specified using one of four formats: 1) the user's SIP address; 2) the user's Universal Principal Name; 3) the user's domain name and logon name, in the form domain\logon (e.g., litwareinc\kenmyer); and, 4) the user's Active Directory display name (for example, Ken Myer). Note that the SAMAccountName cannot be used as an identity; that's because SamAccountNames are not necessarily unique in a forest.

In addition, you can use the asterisk (*) wildcard character when using the Display Name as the user Identity. For example, the Identity "* Smith" would return all the users with display name that ends with the string value "Smith".

PolicyName

Optional

Identity of the per-user policy to be assigned. For example: -PolicyName "RedmondPresencePolicy". Optionally, you can include the tag: prefix when specifying the policy name; for example: -PolicyName "tag:RedmondPresencePolicy".

DomainController

Optional

Fully qualified name of the domain controller to be contacted when assigning the policy. For example: -DomainController atl-dc-001.litwareinc.com.

If not specified, Grant-CsPresencePolicy will contact the nearest available domain controller when assigning the policy.

PassThru

Optional

Enables you to pass a user object through the pipeline that represents the user being assigned the policy. By default, Grant-C cmdlet does not pass objects through the pipeline.

WhatIf

Optional

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

Confirm

Optional

Prompts you for confirmation before executing the command.

Detailed Description

Presence information (which, among other things, lets you know whether a contact is available to take part in an instant messaging conversation) is invaluable. At the same time, however, there is a cost associated with presence information: the more presence subscriptions you have the more network bandwidth must be devoted to updating presence information. If network bandwidth is a concern, you might want to limit the number of presence subscriptions any one user can have.

The CsPresencePolicy cmdlets enable you to manage two important aspects of presence subscriptions: prompted subscribers and category subscriptions. When you are added to another person’s Microsoft Communicator contact list, the default behavior is for you to receive a pop-up notification informing you that you have been added to that list. Until you dismiss the resulting dialog box, each notification counts as a prompted subscriber. The presence policy’s MaxPromptedSubscriber property enables you to specify the maximum number of unresolved notification dialogs a user can have. (If a user reaches the maximum amount then he or she will not receive new contact notifications, at least not until some of those dialogs have been resolved.)

Category subscriptions represent a request for a specific category of information; for example, an application that requests calendar data. The MaxCategorySubscription property enables administrators to place a limit on the number of category subscriptions a user can have.

Prior to the release of Microsoft Communications Server 2010 prompted subscriber and category subscriptions were managed on a global basis. With the CsPresencePolicy cmdlets you can now manage these presence subscriptions at the global scope, the site scope, or even the per-user scope. This enables you to control bandwidth use while, at the same time, ensuring that users have access to the presence information they need to do their jobs.

When you create a per-user policy, that policy is not automatically assigned to anyone. Instead, per-user presence policies must be explicitly assigned to users (or groups of users) by running the Grant-CsPresencePolicy cmdlet.

Return Types

Grant-CsPresencePolicy assigns instances of the Microsoft.Rtc.Management.WriteableConfig.Policy.Presence.PresencePolicy object.

Examples

-------------------------- Example 1 ------------------------

Copy Code
Grant-CsPresencePolicy -Identity "Ken Myer" -PolicyName "RedmondPresencePolicy"

The command shown in Example 1 assigns the per-user presence policy RedmondPresencePolicy to a single user: the user with the Identity Ken Myer.

-------------------------- Example 2 ------------------------

Copy Code
Get-CsUser -OU "OU=Redmond,dc=litwareinc,dc=com" | Grant-CsPresencePolicy -PolicyName "RedmondPresencePolicy"

In Example 2, the presence policy RedmondPresencePolicy is assigned to all the users who have accounts in the Redmond OU in Active Directory. To do this, the command first uses Get-CsUser and the –OU parameter to return a collection of all the user accounts found in the Redmond OU (OU=Redmond,dc=litware,dc=com). This collection is then piped to the Grant-CsPresencePolicy, which assigns RedmondPresencePolicy to each user in the collection. Note that you do not need to use the –Identity parameter when piping information to Grant-CsPresencePolicy.

-------------------------- Example 3 ------------------------

Copy Code
Get-CsUser -LDAPFilter "l=Redmond" | Grant-CsPresencePolicy -PolicyName "RedmondPresencePolicy"

The preceding command assigns the policy RedmondPresencePolicy to all the users who work in the city of Redmond. To carry out this task, the command first uses Get-CsUser and the –LDAPFilter parameter to return a collection of all the users who work in Redmond; the filter value "l=Redmond" limits the returned data to users from Redmond. (In the LDAP query language, "l" is short for "locality".) The retrieved collection is then piped to Grant-CsPresencePolicy, which assigns RedmondPresencePolicy to each user in the collection.

-------------------------- Example 4 ------------------------

Copy Code
Get-CsUser -LDAPFilter "l=Redmond" | Grant-CsPresencePolicy -PolicyName $Null

The command shown in Example 4 "unassigns" all the per-user policies assigned to users who work in Redmond. Calling Grant-CsPresencePolicy by setting the –PolicyName parameter to a null value ($Null) causes Grant-CsPresencePolicy to remove any per-user presence policies to the users affected by the command.