WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Error 1068 The server is unwilling to Perform


Question:

We recently upgraded our domain controllers from Windows 2000 to Windows 2003. -The domain is still in AD 2000 "mode." We haven't upgrade the operations mode to AD 2003. I been using a script to create user accounts without incident for the past several months. Now I am getting the 1068 error message on the dsSetObj command. Not sure why... The scenarios are:

A) dsSetProperty(sObjectPath,'userAccountControl','1') before the dsSetOgj line will consistently return the 1068 error
B) Omitting the dsSetProperty(sObjectPath,'userAccountControl','1') line will continue to create the account, but naturally it is disabled.
C) If I put the dsSetProperty(sObjectPath,'userAccountControl','1') line after the dsSetObj line then I get the 1068 message with information stating that the account already exists and is active (which it is not).

I'm lost...
The full function looks like this:

#DefineFunction CreateBOSUserObject(Domain,sAdsiPath,sUserName,sSamName)
dsSetCredent('%Domain%\svcscript','pword') ; Legacy username call
sObjectClass = 'user'
sObjectPath = dsCreateObj(sAdsipath, sObjectClass, sUserName) 
sProperty = 'samAccountName'
dsSetProperty(sObjectPath, sProperty, sSamName)
dsSetObj(sObjectPath) 
dsSetProperty(sObjectPath,'userAccountControl','1') ; The user's account is enabled. 
Return
#EndFunction
The parameters passed are:
Domain = OurDomainName
sAdsiPath = LDAP://OurDomainName/OU=Users,OU=Building,DC=DomainName
sUserName = CN=bblahhh 
sSamName = bblahhh

The wwwbatch.ini contents is:

[ADSI Extender]
ErrorCode=1325
ErrorText=0000052D: SvcErr: DSID-031A0FBC, problem 5003 (WILL_NOT_PERFORM), data 0

Provider=LDAP Provider
Any help resolving this would be greatly appreciated.

Answer:

I am kind of surprised it ever worked. The "userAccountControl" property is a bit mask so you need to change it a bit at a time.
UF_ACCOUNTDISABLE = 1
nValue = dsGetProperty( sObjectPath, "userAccountControl")
nValue = nValue | UF_ACCOUNTDISABLE
dsSetProperty(sObjectPath, "userAccountControl", nValue)
There may be an additional cause of your problem but I would definitely change your script to work like the above.

User Reply:

I found the solution. Obscure but may be something to make note of in case this comes up again.

If you've implemented a password policy, the account has to have a password that meets the policy before it's enabled. (You can create the account, but not enable it). To fix this problem we simply moved the DsSetPassword routine to happen before the activation of the account. Kapoof, problem solved.


Article ID:   W16312
File Created: 2005:02:18:12:19:46
Last Updated: 2005:02:18:12:19:46