-2147016657 error setting attribute in AD

Discussion in 'Scripting' started by Tim Kalligonis, Aug 27, 2008.

  1. I am having an odd problem with a pretty basic script. The script is used
    to set an attribute, primarily pwdlastset, but those specifics don't matter
    because I get the same error with other attributes as well.

    If I use AD users and Computers I am able to set the attributes no problem,
    but when I try to set the attributes via vbscript I get error 2147016657.
    From what I've been able to find this is a constraint violation.

    The script works fine with an account that has domain admin credentials
    which led me to believe it was an access problem, but the other account
    having problems has full control on user objects.

    objUser.Put "pwdLastSet", 0

    Any ideas on why this action will work through the GUI and not via script?
    Tim Kalligonis, Aug 27, 2008
    1. Advertisements

  2. Tim Kalligonis

    Al Dunbar Guest

    Please show the specific code, not just the .put and .setinfo statements,
    specifically the statements that create the objUser object.
    Which of these two statements is the one that actually results in the error?
    I suspect there may be something wrong with your script, how you are using
    it, or with the credentials of the account you are using. If the script
    works fine when run from a domain admin account, I'd lean towards thinking
    this was a privilege issue. If the non-admin account can make the changes in
    ADU&C, then it should be able to do so via script - *assuming* that the
    script does not initially attempt to access some area that the account has
    no access to.

    FYI, I run a number of scripts that modify AD attributes from an account
    that has full access to administer accounts in a small number of our OUs.

    Al Dunbar, Aug 27, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.