Err got when update pwd in Active directory

  • Thread starter Thread starter happybubble
  • Start date Start date
H

happybubble

Hi,

I got a trouble when migrating an application from NT to win2k3.
In the code, I use LDAP to update pwd in Active Directory. It works
well in NT server. But in win2k3 server, I got an error at this code:


objUser.setinfo


The err msg is "Genenral access denied error".
It is weird cause I use same account and same code in NT server and it
works well.


Can somebody help me?
This thing blocked me almost a week and made me mad...
 
Thanks for replay, Jorge.
Here is the main part of the code:

Set objUser =
GetObject("LDAP://CN=MyAccount,OU=Controlled,OU=Functional,OU=Com1
Users,DC=Com1,DC=Com2")

'GENERATE A PASSWORD
strTempPassword = "AgecjAjs"

'SET THE ACCOUNT ACTIVE VIA ADSI
objUser.IsAccountLocked = 0

'SET THE ACCOUNT PASSWORD TO THE TEMPORARY PASSWORD
objUser.SetPassword strTempPassword

'SET THE ACCOUNT TO RESET WITHIN 24 HOURS
objUser.AccountExpirationDate = dteExpire

'COMMIT THE ADSI CHANGES
objUser.SetInfo

Can someone give me any suggestion?
 
happybubble said:
Thanks for replay, Jorge.
Here is the main part of the code:

Set objUser =
GetObject("LDAP://CN=MyAccount,OU=Controlled,OU=Functional,OU=Com1
Users,DC=Com1,DC=Com2")

'GENERATE A PASSWORD
strTempPassword = "AgecjAjs"

'SET THE ACCOUNT ACTIVE VIA ADSI
objUser.IsAccountLocked = 0

'SET THE ACCOUNT PASSWORD TO THE TEMPORARY PASSWORD
objUser.SetPassword strTempPassword

'SET THE ACCOUNT TO RESET WITHIN 24 HOURS
objUser.AccountExpirationDate = dteExpire

'COMMIT THE ADSI CHANGES
objUser.SetInfo

Can someone give me any suggestion?

who are you running the script as, under what account? You'll need
admin privileges to set attributes for a user otherwise only a user can
set their own attributes.
 
The account I run the script as doesn't have admin privileges. But I
can use this account log on DC to update AD. And in NT server I use
same account and same script, it works well.
Is there any differences on security configuration between NT and
win2k3?
 
Back
Top