Query of $ users returns nothing

I am trying to retrieve the users off of a particular server using the COM toolkit and .Net out of the ($People) view.This is what I am currently doing:

NotesView peopleView = notesDir.Db.GetView(“($People)”);

Then out of the peopleView :

peopleView.FTSearch(“FIELD MailServer contains "labvm-004" & FIELD MailServer contains "lab004"”, 0);

It returns no users,

Any advice or help would be greatly appreciated.

Subject: I think you want a ‘|’ (or) instead of a '&" (and) in the middle of your query

Subject: RE: I think you want a ‘|’ (or) instead of a '&" (and) in the middle of your query

I was under the impression that the /o meant that it would be in that organization and that multiple servers would be under that organization :org1

serverA ( cn=org1/o=serverA )

serverB ( cn=org1/o=serverB )

Is that not correct? and only searching on the org will get me all the users on a single server?

Thank you.

Subject: query of $ users returns nothing

Use this instead :

Dim nab As New NotesDatabase(“server”, “names.nsf”)

Dim peopleview As nOtesview

Set peopleView = nab.GetView(“($People)”)

numcount = peopleView.FTSearch(|FIELD MailServer contains “SRV1” or FIELD MailServer contains “SRV2”|, 0)

If (numcount < 1) Then

Msgbox “No records found…”

Else

Msgbox Cstr(numcount) + " records found !"

End If

where SRV1 = labvm-004 and

SRv2 = LAB004

use “and”/“or” as parameters to concatenate query strings.

HTH

Sriram

Subject: RE: query of $ users returns nothing

That worked, but it gives me everyone in the organization, not everyone on a single server. Is there a better way of retrieving users off of a server across R5 and R6?

The mailserver name that I have is “cn=labvm-004/o=lab004” and what I would like to do is to retrieve users using this. Is there a way?

Subject: Then you want exactly what you said. “[MailServer] contains "CN=labvm-004/O=lab004"”

Subject: RE: Then you want exactly what you said. “[MailServer] contains "CN=labvm-004/O=lab004"”

Unfortunately that works under R6 but not under R5. Any ideas?

Subject: RE: Then you want exactly what you said. “[MailServer] contains "CN=labvm-004/O=lab004"”

I believe this is a problem with the fact that the server name has a hyphen in it. If I remove the hyphen and structure the query differently, everything works. Is there a way to escape the hyphen when it is full text searched? or to force an exact match?