Editing the xml configuration of an RCDC can be time consuming if you have a lot of custom objects and or attributes in the portal schema. This article describes a way to automate this task completely. It also provides a start in implementing this approach in powershell using the System.Xml.Linq library.
If you create a new object type in the portal schema, you want the end users to have a nice rcdc instead of the default interface. The portal offers you the ability to download a template file that you can then edit. If you strip this template file further, only retaining fields for display name and description, it is possible to reuse this as a starting point for all future rcdc's by editing the caption. A function could read such a local copy of the stripped down template, edit the caption and return the result.
The creation of a new rcdc requires following parameters:
Creation of a new rcdc for the custom object Department could look like this:
Updating the rcdc is a little bit more complex. Controls need to be constructed. A separate function for each type of control can be defined.
After generating the xml configuration for a control it needs to be inserted into an existing xml structure. The function that is responsible for this step requires at least following inputs:
Validation steps can be added before uploading xml configuration data, preventing lots of frustrated hours of searching for that one typo. Validation can also be done against manually edited rcdc configuration files and uses a local copy of the xsd schema file from technet.
A lot of work remains. An inverse function for Add-ElementToRcdc, Remove-ElementFromRcdc needs to be implemented. Also, functions to generate other types of rcdc controls are lacking. Anyone can contribute! If you feel like writing a function or two, just go at it and send a pull request on the github project.