locked
Classic ADM file in Windows 2008: MAXLEN error RRS feed

  • Question

  • When loading a classic administrative template into the Windows 2008 GPMC which includes policies using the MAXLEN statement
    e.g. for the control type EDITTEXT”, the GPMC (or rather the GPEdit) GUI will only let you enter data that is one character shorter than defined.

    Any ideas on that?
    Maybe a bug?

    Remark: There are several reasons that - by now - make a conversion of the ADM to ADMX not possible

    Thank you.
    Patrick
    Tuesday, April 28, 2009 9:37 AM

Answers

  • Patrick,

    I was able to repro that issue on my box here. I'll forward this issue to the GP Product Group. You may want to open a case with Microsoft CSS so that they'll provide you with additional steps. I guess it's a bug.

    A workaround that worked on my end here was just to uninstall the hotfix and restart GPEdit.msc (no reboot needed).

    I'll let you know that they say.

    Cheers,
    Florian


    Microsoft MVP - Group Policy -- blog: http://www.frickelsoft.net/blog
    • Marked as answer by Joson Zhou Tuesday, May 5, 2009 7:38 AM
    Tuesday, April 28, 2009 4:08 PM

All replies

  • Can you share the ADM template in question?

    Cheers,
    Florian
    Microsoft MVP - Group Policy -- blog: http://www.frickelsoft.net/blog
    Tuesday, April 28, 2009 11:27 AM
  • Florian, just try this little sample:
    I used MAXLEN 2 but actually I am able to enter only 1 character into the Text Box then...

    _____________________

    CLASS USER

    CATEGORY !!TestCat
     KEYNAME "Software\TestApp123"
      POLICY !!TestSetting1
             EXPLAIN !!Test_Help
             PART "Number: " EDITTEXT
                VALUENAME "TestValue"  REQUIRED
        MAXLEN 2
             END PART
      END POLICY
    END CATEGORY

    [strings]
    TestCat=TEST ERROR MAXLEN
    TestSetting1 = This demonstrates the MAXLEN bug
    Test_Help = Just one example how bad ADM support is in Windows 2008

    Tuesday, April 28, 2009 12:11 PM
  • Howdie!

    That's interesting - I have imported your ADM template on both Vista and Win7 (client) and Server 2008 and I'm able to enter the MAXLEN number of characters into the field and save it successfully. For MAXLEN 2, I can enter 2 characters. When modifying it to MAXLEN 5, I can enter five characters in there.

    Can you elaborate a little more on your system? Is that a en-us language installation? Anything special around that system? Do you get that on another Server 2008 machine, too?

    cheers,
    Florian
    Microsoft MVP - Group Policy -- blog: http://www.frickelsoft.net/blog
    Tuesday, April 28, 2009 12:39 PM
  • Good hint, Florian.
    I do have en-us machines only here, but of different type: 64bit and 32bit.
    The strange behavior occurs on 64bit only, not n the 32bit OS !
    But to be sure that this is the reason some further testing is needed.

    There is another difference between those machines:
    The 64Bit machine has a special GPO-Editor patch installed:
    http://support.microsoft.com/kb/950085/en-us

    Let's see if we can isolate the issue...
    Tuesday, April 28, 2009 1:28 PM
  • Let me know if you find any new hints on this. In the meantime, I'm going to test that on my x64 server to check that.

    Cheers,
    Florian
    Microsoft MVP - Group Policy -- blog: http://www.frickelsoft.net/blog
    Tuesday, April 28, 2009 1:30 PM
  • OK, that's it.
    It is the mentioned patch (KB950085) that brings this special "feature"...
    I just installed it on my 32bit machine also and - the bug is there!

    Florian, maybe you want to double check this by installing the patch on one of your machines?

    If this is confirmed it's time to call MS.
    Or are the right guys already reading this and taking action?

    Thank you so far.
    Patrick

    Tuesday, April 28, 2009 2:31 PM
  • Patrick,

    I was able to repro that issue on my box here. I'll forward this issue to the GP Product Group. You may want to open a case with Microsoft CSS so that they'll provide you with additional steps. I guess it's a bug.

    A workaround that worked on my end here was just to uninstall the hotfix and restart GPEdit.msc (no reboot needed).

    I'll let you know that they say.

    Cheers,
    Florian


    Microsoft MVP - Group Policy -- blog: http://www.frickelsoft.net/blog
    • Marked as answer by Joson Zhou Tuesday, May 5, 2009 7:38 AM
    Tuesday, April 28, 2009 4:08 PM
  • I think that probably what you're seeing is that in the ADM templates, strings were allocated and stored in the registry as MAXLEN-1 because one character was need to account for the trailing null that is needed when a string is written to the Registry as a REG_SZ or REG_EXPAND_SZ. KB950085 seems to have been a fix to ensure that strings were never stored or accepted that were greater than MAXLEN in length but MAXLEN included the extra trailing null. You can read about the trailing null value that is needed in the explanations of the REG_SZ and REG_EXPAND_SZ registry value types. If that is the case, then the documentation for MAXLEN on MSDN would be incorrect. It reads:

    MAXLEN value Specifies the maximum length of a string. The string in the text box is limited to this length.

    So in reality, the trailing null should be in addition to the value of MAXLEN and not built into it.

    Ray
    Ray Hayes
    Wednesday, April 29, 2009 5:20 AM
  • Ray,

    the thing is ADM templates don't actively store or write anything to the registry. It is actually a Registry.POL file they write to - and the registry pol file is incorporated to the registry later then. The ADM template file - and therefore its element MAXLEN - are just a visual representation to guide/help administrators define settings in a correct format.

    However, I would agree with you if MAXLEN had anything to do with storing the value to the registry - but is only there for limiting the characters you can put into the EDITTEXT textbox. After applying hotfix KB950085, it doesn't allow you to out any more values into the text box than MAXLEN-1 - obviously a change in the hotfix prevents that. This does not involve storing the characters in the registry in the first place. It is just the visual representation of the policy in GPEditor.

    Cheers,
    Florian
    Microsoft MVP - Group Policy -- blog: http://www.frickelsoft.net/blog
    Wednesday, April 29, 2009 5:45 AM
  • By the way, it seems as it is not a problem of ADM only, it can be reproduced with ADMX as well.
    MS support told me that by now W2k8R2 RC has the bug fixed, but it is not clear yet if there will be patch
    for original version of W2K8 (e.g. with SP3).
    Patrick
    Tuesday, May 19, 2009 1:18 PM