Hello,
We use a SQL Server database to manage accounts in AD via a COM object
using ADSI written in VB6.
I have to move this database to a new server. The only real difference
between the two servers is that one is running Windows 2000 Server and
the other is running Windows 2003 Server. Both are running SQL Server
2000.
Everything works on both servers, including ChangePassword. The only
things that works on the old server but not the new is SetPassword. It
gives me the error #2147023570 - "One or more input parameters are
invalid"
Again, running the exact same code works on the 2000 machine, and
ChangePassword works on both. The code is fairly simple:
Dim oNameSp As IADsOpenDSObject
Dim oContanr As IADsContainer
Dim oUser As IADsUser
Dim objpth As String
objpth = GetPath(<user cn>, "user") ' returns the path to the user
If Left(objpth, 7) = "LDAP://" Then
Set oNameSp = GetObject("LDAP:")
Set oContanr = oNameSp.OpenDSObject(objpth, <domain admin
name>,<admin pwd>, 0)
Set oUser = oContanr.GetObject("user", "cn=" & <user cn>)
oUser.SetPassword newpwd
End If
Replace "oUser.SetPassword newpwd" with "oUser.ChangePassword oldpwd,
newpwd" and it works.
Any ideas would be appreciated.