Hi All,
I am new member of this group and scripting as well, I am using one VB script to send mail to all the domain users whose password is expire in no of days. For this i am using below code and its working fine.


Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
Set objDomain = GetObject("LDAP://" & strDNSDomain)
Set objMaxPwdAge = objDomain.MaxPwdAge


' Function to convert Integer8 (64-bit) value to a date, adjusted for
' local time zone bias.
Function Integer8Date(ByVal objDate, ByVal lngBias)
Dim lngAdjust, lngDate, lngHigh, lngLow
lngAdjust = lngBias
lngHigh = objDate.HighPart
lngLow = objDate.LowPart
' Account for error in IADsLargeInteger property methods.
If (lngLow < 0) Then

lngHigh = lngHigh + 1
End If
If (lngHigh = 0) And (lngLow = 0) Then
lngAdjust = 0
End If
'Line-----200
lngDate = #1/1/1601# + (((lngHigh * (2 ^ 32)) _
+ lngLow) / 600000000 - lngAdjust) / 1440

' Trap error if lngDate is ridiculously huge.
On Error Resume Next
Integer8Date = CDate(lngDate)
If (Err.Number <> 0) Then
On Error GoTo 0
Integer8Date = #1/1/1601#
End If
On Error GoTo 0

My issue is this when i try for particular OU then its giving me the error, i am using below code for that, but not working.

Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")

Set objOU = GetObject("LDAP://OU=Noida,DC=london,DC=local")
For each objMember in ObjOU
Set objMaxPwdAge = objDomain.MaxPwdAge

and then the function which i m using as above but it giving me syntax error in function line.

Hope you understand my issue.

Thanks
Mukesh
ISS