S
Schmidtmayer Marc
Hi all,
Sorry for my question but I'm not a Visual Basic developer ...
I want to test the 'pwdLastSet'-property in order to see if it's 0.
So I want to put this property in a LargeInteger or an
IADsLargeInteger BUT I get the following ERROR : "OBJECT VARIABLE OR
WITH BLOCK VARIABLE NOT SET".
I don't know what I'm doing wrong !!???
Plese can someone help ...
Here's (an extract of) my code :
'****************************************************************************
...
'Dim nPwdLastSet As IADsLargeInteger
Dim nPwdLastSet As LargeInteger
...
strFilter = "(&(objectclass=user)(objectcategory=person));"
strAttrs = "name,userprincipalname,useraccountcontrol,adspath,pwdlastset;"
strScope = "subtree"
Set objConn = CreateObject("ADODB.Connection")
objConn.Provider = "ADsDSOObject"
objConn.Open "Active Directory Provider"
lPaths = UBound(as_paths())
For lLoop = 1 To lPaths
strBase = "<" & as_paths(lLoop) & ">;"
Set objRS = objConn.Execute(strBase & strFilter & strAttrs &
strScope)
If Not objRS.EOF Then
objRS.MoveFirst
While Not objRS.EOF
nPwdLastSet = objRS.Fields(4).Value '--> ERROR !
RaiseEvent ADSecOutput(ADSEC_INFO, strModule & "high =
" & CStr(nPwdLastSet.HighPart))
RaiseEvent ADSecOutput(ADSEC_INFO, strModule & "low =
" & CStr(nPwdLastSet.LowPart))
objRS.MoveNext 'volgende
Wend
End If
Next
'*******************************************************************************
Thanks,
Marc.
Sorry for my question but I'm not a Visual Basic developer ...
I want to test the 'pwdLastSet'-property in order to see if it's 0.
So I want to put this property in a LargeInteger or an
IADsLargeInteger BUT I get the following ERROR : "OBJECT VARIABLE OR
WITH BLOCK VARIABLE NOT SET".
I don't know what I'm doing wrong !!???
Plese can someone help ...
Here's (an extract of) my code :
'****************************************************************************
...
'Dim nPwdLastSet As IADsLargeInteger
Dim nPwdLastSet As LargeInteger
...
strFilter = "(&(objectclass=user)(objectcategory=person));"
strAttrs = "name,userprincipalname,useraccountcontrol,adspath,pwdlastset;"
strScope = "subtree"
Set objConn = CreateObject("ADODB.Connection")
objConn.Provider = "ADsDSOObject"
objConn.Open "Active Directory Provider"
lPaths = UBound(as_paths())
For lLoop = 1 To lPaths
strBase = "<" & as_paths(lLoop) & ">;"
Set objRS = objConn.Execute(strBase & strFilter & strAttrs &
strScope)
If Not objRS.EOF Then
objRS.MoveFirst
While Not objRS.EOF
nPwdLastSet = objRS.Fields(4).Value '--> ERROR !
RaiseEvent ADSecOutput(ADSEC_INFO, strModule & "high =
" & CStr(nPwdLastSet.HighPart))
RaiseEvent ADSecOutput(ADSEC_INFO, strModule & "low =
" & CStr(nPwdLastSet.LowPart))
objRS.MoveNext 'volgende
Wend
End If
Next
'*******************************************************************************
Thanks,
Marc.