Here is where I am now:
Code:
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdSubmit_Click()
Dim objOU As Object, objUser As Object, objRootDSE As Object
Dim strContainer As String, strDNSDomain As String, strPassword As String
Dim strDN As String
Dim intPwdValue As Integer
'Bind to Active Directory Domain
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.get("DefaultNamingContext")
strContainer = "OU=Domain Users,"
strPassword = "P@ssw0rd"
strContainer = strContainer & strDNSDomain
'Here we force a change of password at next logon
intPwdValue = 0
strDN = ("LDAP://cn=" & txtStuNum.Text & "," & strContainer)
Debug.Print strDN
Set objOU = GetObject(strDN)
'Set objOU = GetObject("LDAP://cn=" & txtStuNum.Text & "," & strContainer)
objUser.SetPassword strPassword
objUser.Put "PwdLastSet", intPwdValue
objUser.SetInfo
End Sub When I run it, I get the same error:
"Run-time error '2147016656 (80072030)': There is no such object on the server"
When I debug, the "Set objOU = GetObject(strDN)" line is highlighted in yellow.
This may help, the value of strDN is:
LDAP://cn=0007,OU=Domain Users,DC=arnewood,DC=net
But the value of objOU has a value of:
Nothing