Wednesday, April 22, 2015

ADMX Migrator Surprise: Enabling a Setting Must Affect a Key

(Maybe this isn't so much of an ADMX Migrator surprise, since it could happen even if I manually wrote the ADMX file. And I suppose it's not too much of a surprise either, since careful reading of documentation might have prevented my misunderstanding. Eh. I'll write this post anyway.)

I was working on some custom Group Policy settings that have at least one text field each. I noticed that the settings wouldn't stay Enabled after I set them (they would revert to Not Configured when I hit OK), but they would stay Disabled.

Now, ADMX Migrator makes you specify the following information for each setting: registry key, registry value name, "enabled" value, and "disabled" value. Those last two can be one of "None", "Deleted", "String", or "Numeric". Since I was doing all the work in the registry value associated with the text box, I wasn't sure what to supply for the setting's key. I had used the same registry value name for the text box and the setting. I had also used "None" for the Enabled value.

That last choice occasionally produced a warning message in the GPME saying something about an XML error. My first mistake, though, was much more subtle. You see, every Group Policy setting has to either set or destroy a registry value. (Not necessarily order-respective for Enabled and Disabled there.) The fix was to change the setting's value to something like "ConfiguredSpn" so that the program knows to then look for "Spn", the value set by the text box.

No comments:

Post a Comment