Read OCS User Properties with PowerShell.
The script uses ADODB to search the Active Directory for the user, retrieves each of the OCS related attributes, and prints them to the screen. It's a handy way to determine if the user is OCS enabled, what their SIP address is, what policies are set, whether the user's IM's are archived, etc.
The script demonstrates how to read each of these properties, including the option flags, which is a bit mask of various options, as well as the policies, which are DNwithBinary objects that require a little skill to unpack.
To use the script, you have to have Perl of course, which can be downloaded free from ActiveState. Next, copy the code and save it as a perl script file, such as getOCSproperties.pl then, from the command prompt, launch the script, using the user name (common name, logon name, or display name) as the argument. Use quotes around the user name if there are any spaces in it. Examples are:
getOCSproperties.pl "Seltzer, Brian"
Here's the script:
Enjoy! We appreciate the visitor's request. It's good to know what people are looking for, and we're happy to help when we can.