Configuring Presence Policies Using Configure Policies Script
Topic Last Modified: 2009-03-04
A presence policy is a set of limits and restrictions that affect presence. By default, the Default Policy and Service: Medium presence policies are installed when you deploy Office Communications Server 2007 R2. You can create additional presence policies or modify the settings of an existing presence policy.
Note
We recommend that you not modify the settings on the Default Policy and Service: Medium presence policies.
Using ConfigurePolicies.wsf
The Microsoft Office Communications Server 2007 R2 Configure Global Policies script (ConfigurePolicies.wsf) is a Windows Management Instrumentation (WMI) script that is used to add, update, assign, and delete policies. ConfigurePolicies.wsf can be downloaded from the Microsoft Script Center at https://go.microsoft.com/fwlink/?LinkId=139853.
You must be a member of the RTCUniversalServerAdmins group in order to run the ConfigurePolicies.wsf script. The script can be run from any computer that has Office Communications Server 2007 R2 or the Office Communications Server 2007 R2 administrative tools installed.
Syntax
cscript ConfigurePolicies.wsf /Action:<value> [/PolicyType:<value>] [/DataFile:<value>] [/PolicyName:<value>]
The following table describes the available options.
Table 1. Command-Line Options
Option | Description |
---|---|
Action |
The action to take. Valid values are AddUpdate, Assign, UseUserPolicy, or Delete. |
PolicyType |
The policy type. Valid values are Presence, Meeting, or OC. |
DataFile |
The name of the file that contains the policy settings. This option is used with the AddUpdate action. |
PolicyName |
The name of the policy. This option is used with the Assign or Delete action. |
Creating, Updating, and Deleting Policies
You can create additional presence policies, modify the settings of an existing presence policy, or delete a presence policy. The AddUpdate action creates a new policy or replaces an existing policy with the policy properties and settings included in the specified data file.
Note
For details about presence policy settings, see Presence Policy Settings.
The data file used in the /DataFile option must be in ANSI or Unicode format and have the following format:
PropertyName:=PropertyValue
The following is an example of a data file:
Name:=Presence Policy 1
CategorySubscriptions:=2000
DefaultPolicy:=False
PromptedSubscribers:=200
Type:=presence
Using the data file from above, the following example creates a new presence policy called Presence Policy 1. If you already have a presence policy called Presence Policy 1, the same command updates that policy.
cscript ConfigurePolicies.wsf /Action:AddUpdate /PolicyType:Presence /DataFile:PresencePolicy1.txt
The following example deletes the presence policy called Presence Policy 1.
cscript ConfigurePolicies.wsf /Action:Delete /PolicyType:Presence /PolicyName:”Presence Policy 1”
Choosing Between Global or Per-User Policy Modes
There are two ways to configure policies at the global level. You can choose the global policy mode, which assigns the same policy to all users. Or, you can use the per-user policy mode. With the per-user policy mode, you can assign a policy that is assigned to users by default, but you still have the option to assign a different policy to one or more users.
Using Global Policy Mode
You can use the Assign action to specify which presence policy to use as the global policy. The following example specifies the Default Policy presence policy as the global policy.
cscript ConfigurePolicies.wsf /Action:Assign /PolicyType:Presence /PolicyName:”Default Policy”
Using Per-User Policy Mode
Use the per-user policy mode if you want to be able to assign a different presence policy to specific users. The following example enables per-user policy. Users are assigned the Default Policy presence policy by default.
cscript ConfigurePolicies.wsf /Action:UseUserPolicy /PolicyType:Presence /PolicyName:”Default Policy”
You can now assign a different presence policy to specific users. This is performed using the LCSEnableConfigureUsers.wsf script. The LCSEnableConfigureUsers.wsf script has the following syntax.
cscript LCSEnableConfigureUsers.wsf /UsersFile:<value> /ConfigFile:<value>
Note
The LCSEnableConfigureUsers.wsf and OCSGetTemplateFromUser.wsf scripts can be downloaded from the Microsoft Script Center at https://go.microsoft.com/fwlink/?LinkId=139853.
To assign a policy to a user or a group of users
Create the users file.
The users file is a text file that contains a list of the SIP URI address of the users that you want to modify. The following is an example of a users file.sip:user2@contoso.com sip:user3@contoso.com
Create the configuration settings file.
The configuration settings file is a text file that contains the settings that will be assigned to the list of users. The following is an example of a configuration settings file.AllowOrganizeMeetingWithAnonymousParticipants:=False ArchiveFederatedCommunications:=False ArchiveInternalCommunications:=False Enabled:=True EnabledForEnhancedPresence:=True EnabledForFederation:=False EnabledForInternetAccess:=False PoolName:=SERVER IPPBXSoftPhoneRoutingEnabled:=False PresencePolicy:=Presence Policy 1 PublicNetworkEnabled:=False RemoteCallControlTelephonyEnabled:=False UCEnabled:=True
Note
You can use the OCSGetTemplateFromUser.wsf script to create a template settings file:
cscript OCSGetTemplateFromUser.wsf /sipuri:user1@contoso.com >>ConfigSettings.txt
. This creates a file that contains the configuration settings of user1. You can then modify the settings in the file as needed.Run the LCSEnableConfigureUsers.wsf script to assign a policy to the users.