Platform SDK: Active Directory, ADSI, and Directory Services

IADsFileServiceOperations::Sessions

The IADsFileServiceOperations::Sessions method gets a pointer to the IADsCollection interface on a collection of the session objects representing the current open sessions for this file service.

HRESULT IADsFileServiceOperations::Sessions(
IADsCollection ** ppSessions  
);

Parameters

ppSessions
[out] Indirect pointer to the IADsCollection interface used to enumerate objects that implement the IADsSession interface and represent the current open sessions for this file service.

Return Values

This method supports the standard return values including S_OK. For other return values, see ADSI Error Codes.

Remarks

Traditional directory services supply information only about directory service elements that are represented in the underlying data store. Information about sessions for file services may not be available from the underlying store.

Example Code [Visual Basic]

The following Visual Basic code snippet shows how to enumerate active sessions managed by a file service.

Dim fso as IADsFileServiceOperations
'  Bind to a file service operation on "myComputer" 
'  in the local domain.
Set fso = GetObject("WinNT://myComputer/LanmanServer")
' Enumerate sessions
For Each session In fso.sessions
MsgBox "Session name: " & session.Name
Next session

Example Code [C++]

For a C++ code snippet using the IADsFileServiceOperations::Session interface, see the code snippet given in IADsSession.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IADsCollection, IADsFileService, IADsFileServiceOperations, IADsSession