When adding or modifying Active Directory users with an Office Communication Server script, you may have to set the user's meeting policy or enterprise voice policy, or both. In my previous post, I show how to read the contents of the msRTCSIP-UserPolicy attribute. Now let's cover how to write to it. When reading the attribute, we find that the contents are either a single or an array of DNwithBinary objects, we get the DNString and BinaryValue properties of these objects and chew on them. Luckily, writing these objects is very simple since they happily accept string input.
The string format is like so:
The possible policy types are:
01000000: Meeting Policy
02000000: UC Policy (Voice)
04000000: Presence Policy
To figure out the DN of your policy objects, have a look at my post: List OCS Pools and Policies
So, let's say you have a meeting policy (01000000), your string should look something like this (your GUID will be different of course):
Once you have assembled the string for your policy you can now write to the attribute.
Write a single policy using VBScript
Write a single policy using Perl
If you have multiple policies to write (e.g. a meeting policy and a voice policy), then you put the two strings into an array and write the array to the attribute (using the PutEX method):
Write multiple policies using VBScript
Write multiple policies using Perl
OK I think that horse is dead. That's how you write to the mcRTCSIP-UserPolicy attribute.