Hi,
Thanks for information. I managed with other scipt and taken report.
Regards, Ranjan "neothwin" wrote:
[Quoted Text] > Hi, > > dsquery * "OU=test,dc=your,dc=domain,dc=com" -filter "(&(|(operatingsys > tem=*2003*)(operatingsystem=*2000*))(objectclass=computer))" -attr name > operatingsystem whencreated > > pls try the above dsquery command. you can also try the query string in > csvde command. > pls note the word wrapping and your domain name. > > regards, > > > > "Ranjan" wrote: > > > Hi , > > I am new to scripting. > > How to List of computer with created date for only windows 2000 and 2003 > > servers. > > I created script but not working. Please do the needful. > > > > Thanks and Regards, > > > > Ranjan > > > > > > > > ------------ > > > > > > > > Const ADS_SCOPE_SUBTREE = 2 > > > > dtmCreationDate = "20001230000000.0Z" > > > > > > Set objConnection = CreateObject("ADODB.Connection") > > Set objCommand = CreateObject("ADODB.Command") > > objConnection.Provider = "ADsDSOObject" > > objConnection.Open "Active Directory Provider" > > Set objCommand.ActiveConnection = objConnection > > > > objCommand.CommandText = _ > > "SELECT Name, operatingSystem, whenCreated FROM " _ > > & "'LDAP://DC=fabrikam,DC=com' WHERE objectClass='computer' " _ > > & "and operatingSystem = 'Windows 2000 Server)'" _ > > & "and whenCreated>='" & dtmCreationDate & "'" > > > > objCommand.Properties("Page Size") = 1000 > > objCommand.Properties("Timeout") = 30 > > objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE > > objCommand.Properties("Cache Results") = False > > Set objRecordSet = objCommand.Execute > > > > > > objRecordSet.MoveFirst > > Do Until objRecordSet.EOF > > Wscript.Echo "Computer Name: " & objRecordSet.Fields("Name").Value > > Wscript.Echo " whenCreated: " & objRecordSet.Fields("whenCreated ").Value > > objRecordSet.MoveNext > > Loop > >
|