Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > -2147016657 error setting attribute in AD

Reply
Thread Tools Display Modes

-2147016657 error setting attribute in AD

 
 
Tim Kalligonis
Guest
Posts: n/a

 
      08-27-2008
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
objUser.setinfo


Any ideas on why this action will work through the GUI and not via script?


 
Reply With Quote
 
 
 
 
Al Dunbar
Guest
Posts: n/a

 
      08-27-2008

"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


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System Image Manager --> Unknown setting attribute xmlns:wcm Alex Fischer Windows Vista Installation 4 12-07-2006 05:23 AM
Re: Setting a user attribute Tomasz Onyszko Active Directory 0 11-17-2006 12:02 PM
RE: Setting lastlogoff attribute chafey13 Active Directory 0 09-17-2006 05:03 AM
RE: Setting lastlogoff attribute TC-UK Active Directory 0 09-08-2006 12:27 PM
Re: Setting lastlogoff attribute Richard Mueller Active Directory 0 09-07-2006 05:49 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59