win32net.NetSessionEnum

(dict,...) = NetSessionEnum(level, server , client , username )

Returns network sessions for a server, limited to single client and/or user if specified.

Parameters

level : int

Level of information requested, currently accepts 0, 1, 2, 10, and 502

server=None : string/PyUnicode

The name of the server for which to list sessions, local machine assumed if None

client=None : string/PyUnicode

Name of client computer, or None to list all computer sessions

username=None : string/PyUnicode

User name, or None to list all connected users

Return Value

Returns a sequence of dictionaries representing SESSION_INFO_* structs, depending on level specified