Thanks for the help--But Im having a little bit of
trouble with the last line it keeps erroring out on this
line--I coppied what you have and saved it as .vbs but it
errors out--any ideas?
Thanks
-----Original Message-----
This script does this. Sae it as .vbs and run it on your domain
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
Set objDSE = GetObject("LDAP://rootDSE")
objCommand.CommandText = "<LDAP://" & objDSE.Get ("defaultNamingContext") & _
">;(&(&(ObjectCategory=Person)(objectClass=User)
(userAccountControl:1.2.840.113556.1.4.803:=65536)))"&
_ ";distinguishedname;subtree"Set objRecordSet =
objCommand.ExecuteWhile Not objRecordset.EOF
WScript.Echo objRecordset.Fields("distinguishedname")
objRecordset.MoveNextWendobjConnection.Close--
RegardsMatjaz Ladava, MCSA, MCSE, MCT, MVPMicrosoft MVP
Windows Server - Active (e-mail address removed),
(e-mail address removed)"Luke"
messageDoes anyone know of a Script that will search AD Users>
and Computers for accounts that have the password never>
expires checked and accounts that have users cannot>
change password checked?