
NetWare 3.12 userlist command - VB3 equivalent
Quote:
>I am looking for any information I can find regarding a way to access the
>equivalent of the userlist command of NetWare 3.12 from a VB DLL call of
>some sort. Ideally, I would like to return an array which I can than use
>to populate a list box to select available user names. Any help would be
>appreciated, even if you just point me in the direction of a FAQ or
>Thanks, Keith
Here is the code that I developed. You will need the NWNETAPI. Let me know if
you have any problems, but this should work for you.
Global Const OT_USER = 1 ' The object is a "user"
'The following needs to be on one line.
Declare Function ScanBinderyObject Lib "NWNETAPI.DLL" (ByVal
_searchObjectName$, ByVal searchObjectType%, objectID&, ByVal objectName$,
_objectType%, objectHasProperties%, objectFlag%, objectSecurity%) As Integer
Sub ScanBindery ()
On Error GoTo bombed
Dim objectType As String * 6
list1.Clear
oID& = -1 'initialize object ID to -1 for first call to
'ScanBinderyObject
Do
oName$ = String$(48, 0)
ccode% = ScanBinderyObject("*", OT_WILD, oID&, oName$, oType%,
_oHasProps%, oFlag%, oSecurity%)
If (ccode% = SUCCESSFUL) Then
If oType% = OT_USER Then
'take all characters of object name up to terminating null
out$ = Left$(oName$, InStr(oName$, Chr$(0)) - 1)
out$ = Left$(out$, 47)
list1.AddItem out$
End If
End If
Loop Until ccode%
Exit Sub
bombed:
MsgBox "bombed"
Exit Sub
End Sub