
The string format is like so:
"B:8:policy type
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):
"B:8:01000000:CN={BA9AD4FA-3516-47BD-A2C2-4556AE4D7263},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com"
Once you have assembled the string for your policy you can now write to the attribute.
Write a single policy using VBScript
Set user = GetObject("LDAP://CN=myUser,CN=Users,DC=myDomain,DC=com") meetingPolicy = "B:8:01000000:CN={BA9AD4FA-3516-47BD-A2C2-4556AE4D7263},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com" user.Put "msRTCSIP-UserPolicy" , meetingPolicy user.SetInfo
Write a single policy using Perl
use Win32::OLE; $user=Win32::OLE->GetObject("LDAP://CN=myUser,CN=Users,DC=myDomain,DC=com"); $meetingPolicy="B:8:01000000:CN={BA9AD4FA-3516-47BD-A2C2-4556AE4D7263},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com"; $user->Put("msRTCSIP-UserPolicy",$meetingPolicy); $user->SetInfo();
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
Set user = GetObject("LDAP://CN=myUser,CN=Users,DC=myDomain,DC=com") meetingPolicy = "B:8:01000000:CN={BA9AD4FA-3516-47BD-A2C2-4556AE4D7263},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com" voicePolicy = "B:8:02000000:CN={3AC49472-2117-4E57-AFEE-63BB8E755D46},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com" policyList = Array(meetingPolicy,voicePolicy) user.PutEx 2 , "msRTCSIP-UserPolicy" , policyList user.SetInfo
Write multiple policies using Perl
use Win32::OLE; $user = Win32::OLE->GetObject("LDAP://CN=myUser,CN=Users,DC=myDomain,DC=com"); $meetingPolicy = "B:8:01000000:CN={BA9AD4FA-3516-47BD-A2C2-4556AE4D7263},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com"; $voicePolicy = "B:8:02000000:CN={3AC49472-2117-4E57-AFEE-63BB8E755D46},CN=Policies,CN=RTC Service,CN=Services,CN=Configuration,DC=myDomain,DC=com"; @policyList = ($meetingPolicy,$voicePolicy); $user->PutEx(2,"msRTCSIP-UserPolicy",\@policyList); $user->SetInfo();
OK I think that horse is dead. That's how you write to the mcRTCSIP-UserPolicy attribute.
No comments:
Post a Comment