The code we are using is in VB and we call a DLL. I am sneding you some ASP
code we have that checks users to see if they are coordinators. Note that VB
code and asp code differ in the object they call; in ASP you must refer to
the CDO object not the PKMCDO object. This code was hanging the machine
senseless as well (all out sharepoint code was giving us problems but never
locally). It seems to work with anon. access disabled.
If you go to Microsoft, their advice is to turn off anon. access in the
vroot dir. for your asp sharepoint pages, or turn it off for any pages
explicitly that has asp/cdo objects in Sharepoint.
In the following code snippet, we create a folder object off the cdo object
knowledge folder. This is set to true if the username is found in the
collection of coordinators. Note, you cannot reference the collection
directly - you have to create a variable off the collection that becomes the
array for the collection.
The end result is a Boolean variable IsCoord that is true if the user is a
coordinator (false if not).
*******************************************************************
'INFORMATION ABOUT THE SERVER.
sServerURL = "http://" & strComputerName
'INFORMATION ABOUT THE FOLDER.
sServerFolder = sServerURL & "/" & strFoldername & "/"
Set objFolder = CreateObject("CDO.KnowledgeFolder")
IsCoord = false
objFolder.DataSource.Open sServerFolder ', , adModeReadWrite
collection = objFolder.Coordinators
'REsponse.write "Number of Co-ordinators:" & uBound(collection) & "<BR>"
For i=0 to uBound(collection)
collection(i) = lcase(collection(i))
'RESPONSE.WRITE "<font color='red' size='1'>"
'RESPONSE.WRITE "Person(" & i & ") " & collection(i) & "<br>"
'RESPONSE.WRITE "<font>"
TempUserName = lcase(Session("Username"))
if instr(collection(i),TempUserName) > 0 then
IsCoord = True
exit for
end if
Next
set objfolder= nothing
*******************************************************************