Platform SDK: Active Directory, ADSI, and Directory Services |
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 );
This method supports the standard return values including S_OK. For other return values, see ADSI Error Codes.
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.
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
For a C++ code snippet using the IADsFileServiceOperations::Session interface, see the code snippet given in IADsSession.
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.
IADsCollection, IADsFileService, IADsFileServiceOperations, IADsSession