"Tim Kalligonis" <> wrote in message
news:%...
>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.
Please show the specific code, not just the .put and .setinfo statements,
specifically the statements that create the objUser object.
> 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
> objUser.setinfo
Which of these two statements is the one that actually results in the error?
>
>
> Any ideas on why this action will work through the GUI and not via script?
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
|