Re: Querying AD..limit?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks for the reply Richard,

Yes if I rem out the sort line it runs.


"Richard Mueller [MVP]" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx> wrote in
message news:OjOGAkvgFHA.3940@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> ADO can handle many more than 10,000 records. Does it help if you do not
> sort? The employeeNumber attribute is not indexed.
>
> --
> Richard
> Microsoft MVP Scripting and ADSI
> Hilltop Lab web site - http://www.rlmueller.net
> --
> "CD" <mcdye1@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:uMClj5ugFHA.3220@xxxxxxxxxxxxxxxxxxxxxxx
>> I have been running the following script within a SQL DTS package daily
> for
>> over two months. Now I am getting the following error.
>>
>> I went back to a previous day that was a success and noticed I had 9969
>> results. I used csvde to get the same records and now I am over 10,000
>> could this be may problem? How to get around?
>>
>> --------------------------------------
>> Error code: 0
>> Error Source: Provider
>> Error Description: The server does not support the requested critical
>> extension.
>>
>> Error on Line 41
>> The server does not support the requested critical extension
>> ---------------------------------------
>>
>> Line 41 is > objRecordSet.MoveFirst
>>
>> '**********************************************************************
>> ' Visual Basic ActiveX Script
>> '************************************************************************
>>
>> Function Main()
>>
>> 'declarations
>>
>> Dim objConnection, objcommand, strDomainString
>> Dim strmail, stremployeeNumber
>> Dim fso, f1, OutputLine1
>> dim strcn
>>
>> Const ForReading = 1, ForWriting = 2, ForAppend = 8
>> Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
>> Const FilePath = "d:\"
>> Const FileName = "IDEmail"
>>
>> strDomainString = "dc=ad,dc=union,dc=edu"
>>
>> 'set text file
>> Set fso = CreateObject("Scripting.FileSystemObject")
>> Set f1 = fso.OpenTextFile(FilePath & FileName & ".txt", ForWriting,
> True)
>>
>> 'Search AD
>> Set objConnection = CreateObject("ADODB.Connection")
>> Set objCommand = CreateObject("ADODB.Command")
>> objConnection.Provider = "ADsDSOObject"
>> objConnection.Open "Active Directory Provider"
>> Set objCommand.ActiveConnection = objConnection
>>
>> objCommand.Properties("Page Size") = 1000
>>
>> objCommand.Properties("Sort On") = "employeeNumber"
>>
>> objCommand.CommandText = _
>> "<LDAP://"; & strDomainString &
>> ">;(&(objectcategory=person)(objectclass=user)(employeeNumber=*));" & _
>> "employeeNumber,mail;Subtree"
>>
>> Set objRecordSet = objCommand.Execute
>>
>> objRecordSet.MoveFirst
>> Do Until objRecordSet.EOF
>>
>> stremployeeNumber = objRecordSet.Fields.Item("employeeNumber").Value
>>
>> strmail = objRecordSet.Fields.Item("mail")
>>
>> 'strcn = objRecordSet.Fields.Item("sAMAccountName").Value
>>
>> ' Write to log file
>>
>> OutputLine1 = "" & strmail & vbTab & stremployeeNumber &""
>> 'OutputLine1 = "" & stremployeeNumber & vbTab & strmail & vbTab & strcn
> &""
>> f1.WriteLine OutputLine1
>>
>> objRecordSet.MoveNext
>>
>> Loop
>>
>> objConnection.Close
>> f1.Close
>>
>>
>> Main = DTSTaskExecResult_Success
>> End Function
>>
>>
>
>


.



Relevant Pages

  • Re: Displaying text output in one external window
    ... application I use to control a script ... the log file and displays it in a ... > Dim oShell ... > Sub SaveScript() ...
    (microsoft.public.scripting.wsh)
  • Re: Reading file from certain point
    ... I need a script to search a log file ... Dim strCTF ... Set objOTF = objFSO.OpenTextFile ...
    (microsoft.public.scripting.vbscript)
  • Re: Recurse issue - 2nd try
    ... My script simply stops short. ... However, when I view the log file, it is missing several files. ... > is your script hanging or does it complete but somehow misses some folders? ... >> Dim sLogFile ...
    (microsoft.public.scripting.vbscript)
  • how can i get the current user which starts the store eventsink???
    ... i have built a script with the EventSink Wizard from the Exchange SDK ... Sub EventLog(EventName As String, ByVal bstrURLItem As String, ... *Dim objSession As MAPI.Session ... LogFile 'Set the path of the log file to be in the Windows System ...
    (microsoft.public.exchange.development)
  • Re: regExp
    ... The first script right now is doing the job without any problems. ... >> routine to move the log file and start a new one. ... > Dim intBEG ... > Set objOTF = Nothing ...
    (microsoft.public.scripting.wsh)