Create Clean Schema File from AD/AM

Dave Bennett 20/07/2006

Have you ever wanted to get a nice clean schema file containing all of your custom attributes and object class entries but excluding the special microsofty attributes from and AD/AM (or AD) instance so that you can archive it off into a source control system or just simply migrate it to another environment?

You dread the task because you never took the time to automate it so you always edit the file by hand. Well here is a simple regex that you can use to clean up the file after you extract it. The regex as written works in editplus (by far the best editor I have ever used, come on buy it, you know you want to), but can can be easily tweaked to work in other editors, scripts, etc.

Anyway, there are three steps…

  1. Extract your data… here is the ldifde way

  2. Prune the unwanted attributes
    In the following section it should all be read as a single regex (ignore line breaks). It should be used in a substitution statement where nothing is substituted for the match.

  3. Replace the AD/AM GUID
    to make it really easy to import into a target environment change the GUID in the file to something easy to type that is not repeated elsewhere in the file.
No Results