hi,

could any one show me the vb script coding that can enumerate the user
accounts that set to 'Password Never Expired'. Thanks.

Fam

Re: User Account by Ray

Ray
Fri Oct 29 18:20:04 CDT 2004

Hi Fam,

This works for me:

Dim oADO, oRS, sSQL

Set oADO = CreateObject("ADODB.Connection")
oADO.Provider = "ADsDSOObject"
oADO.Open "Active Directory Provider"
sSQL = "SELECT adsPath FROM 'LDAP://DC=mydomain,DC=com' WHERE
objectCategory='person' AND userAccountControl = 66048"
Set oRS = oADO.Execute(sSQL)
If Not oRS.EOF Then
Do While Not oRS.EOF
WScript.echo oRS.Fields.Item(0).Value & ""
oRS.MoveNext
Loop
End If
oRS.Close : Set oRS = Nothing
oADO.Close : Set oADO = Nothing

Ray at work


"Fan Fan" <ffan102@hotmail.com> wrote in message
news:uRmvAQevEHA.1308@TK2MSFTNGP09.phx.gbl...
> hi,
>
> could any one show me the vb script coding that can enumerate the user
> accounts that set to 'Password Never Expired'. Thanks.
>
> Fam
>