A module encapsulating the Windows Network API.
-
Retrieves join status information for the specified computer.
-
Retrieves information about a particular group on a server.
-
Enumerates the users in a group.
-
Sets the users in a group on server.
-
Sets information about a particular group account on a server.
-
Creates a new group.
-
Adds a user to a group
-
Deletes a group.
-
Deletes a user from the group
-
Enumerates the groups.
-
Creates a new group.
-
Adds users to a local group.
-
Deletes users from a local group.
-
Deletes a group.
-
Enumerates the groups.
-
Retrieves information about a particular group on a server.
-
Enumerates the members in a local group.
-
Sets information about a particular group account on a server.
-
Sets the members of a local group. Any existing members not listed are removed.
-
sends a string to a registered message alias.
-
Add a message alias for a computer
-
Removes a message alias
-
List message aliases for a computer
-
Retrieves information about all servers of a specific type
-
Retrieves information about a particular server.
-
Sets information about a particular server.
-
Creates a new share.
-
Deletes a share
-
Checks if server is sharing a device
-
Retrieves information about each shared resource on a server.
-
Retrieves information about a particular share on a server.
-
Sets information about a particular share on a server.
-
Creates a new user.
-
Changes a users password on the specified domain.
-
Enumerates all users.
-
Returns a list of groups,attributes for all groups for the user.
-
Retrieves information about a particular user account on a server.
-
Retrieves a list of local groups to which a specified user belongs.
-
Sets information about a particular user account on a server.
-
Deletes a user.
-
Retrieves global user information on a server.
-
Sets global user information on a server.
-
Retrieves information about all users currently logged on to the workstation.
-
returns information about the configuration elements for a workstation.
-
Sets information about the configuration elements for a workstation.
-
Retrieves information about transport protocols that are currently managed by the redirector.
-
binds the redirector to a transport.
-
unbinds transport protocol from the redirector.
-
Retrieves the list of disk drives on a server.
-
Establishes connection between local or NULL device name and a shared resource through redirector.
-
Ends connection to a shared resource.
-
Enumerates connection between local machine and shared resources on remote computers.
-
Get information about locally mapped shared resource on remote computer.
-
Returns the name of any domain controller trusted by the specified server.
-
Returns the name of the primary domain controller (PDC).
-
Returns network session for the server, limited to single client and/or user if specified.
-
Delete network session for specified server, client computer and user. Returns None on success.
-
Get network session information.
-
Returns open file resources for server (single client and/or user may also be passed as criteria).
-
Closes file for specified server and file id.
-
Get info about files open on the server.
-
Return server or workstation stats
-
Adds an extra network name for a server
-
Deletes an emulated computer name created by win32net::PyNetServerComputerNameAdd
-
Verify that computer/domain name is valid for given context
-
Allows an application to check password compliance against an application-provided account database.
win32net.NetFileClose
NetFileClose(servername, fileid) Closes an open network resource on a server
-
servername : string/PyUnicode
Name of server on which to operate, local machine assumed if None
-
fileid : int
Id of opened resource, as returned by win32net::NetFileEnum
win32net.NetFileEnum
(dict,...) = NetFileEnum(level, servername
, basepath
, username
) Lists remotely opened resources on a server
-
level : int
Level of information, 2 or 3 supported
-
servername=None : string/PyUnicode
The name of the server for which to list open resources, local machine assumed if None
-
basepath=None : string/PyUnicode
If specified, limits returned list to files on given path
-
username=None : string/PyUnicode
User that opened resource, or None to list open files for all users
Returns a sequence of dictionaries representing FILE_INFO_* structs, depending on level specified
win32net.NetFileGetInfo
dict = NetFileGetInfo(level, servername
, fileid
) Returns information about an open network resource
-
level : int
Level of information to return, 2 or 3 supported
-
servername : string/PyUnicode
Server on which resource is open, local machine assumed if None
-
fileid : int
Id of opened resource, as returned by win32net::NetFileEnum
win32net.NetGetAnyDCName
PyUnicode = NetGetAnyDCName(server, domain
) Returns the name of any domain controller trusted by the specified server.
-
server=None : PyUnicode
Specifies the name of the remote server on which the function is to execute. If this parameter is None, the local computer is used.
-
domain=None : PyUnicode
Specifies the name of the domain. If this parameter is None, the name of the domain controller for the primary domain is used.
win32net.NetGetDCName
PyUnicode = NetGetDCName(server, domain
) Returns the name of the primary domain controller (PDC).
-
server=None : PyUnicode
Specifies the name of the remote server on which the function is to execute. If this parameter is None, the local computer is used.
-
domain=None : PyUnicode
Specifies the name of the domain. If this parameter is None, the name of the domain controller for the primary domain is used.
win32net.NetGetJoinInformation
PyUnicode, int = NetGetJoinInformation() Retrieves join status information for the specified computer.
win32net.NetGroupAdd
NetGroupAdd(server, level, data) Creates a new group.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : PyGROUP_INFO_*
A dictionary holding the group data.
- Search for NetGroupAdd at msdn, google or google groups.
win32net.NetGroupAddUser
NetGroupAddUser(server, group, username) Adds a user to the group
-
server : string/PyUnicode
The name of the server, or None.
-
group : string/PyUnicode
The group name
-
username : string/PyUnicode
The user to add to the group.
- Search for NetGroupAddUser at msdn, google or google groups.
win32net.NetGroupDel
NetGroupDel(server, groupname) Deletes a group.
-
server : string/PyUnicode
The name of the server, or None.
-
groupname : string/PyUnicode
The group name
- Search for NetGroupDel at msdn, google or google groups.
win32net.NetGroupDelUser
NetGroupDelUser(server, group, username) Deletes a user from the group
-
server : string/PyUnicode
The name of the server, or None.
-
group : string/PyUnicode
The group name
-
username : string/PyUnicode
The user to delete from the group.
- Search for NetGroupDelUser at msdn, google or google groups.
win32net.NetGroupEnum
([dict, ...], total, resumeHandle) = NetGroupEnum(server, level
, resumeHandle
, prefLen
) Enumerates all groups.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetGroupEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyGROUP_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetGroupGetInfo
dict = NetGroupGetInfo(server, groupname
, level
) Retrieves information about a particular group on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
groupname : string/PyUnicode
The group name
-
level : int
The information level contained in the data
- Search for NetGroupGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PyGROUP_INFO_*
formats, depending on the level parameter.
win32net.NetGroupGetUsers
([dict, ...], total, resumeHandle) = NetGroupGetUsers(server, groupName
, level
, resumeHandle
, prefLen
) Enumerates the users in a group.
-
server : string/PyUnicode
The name of the server, or None.
-
groupName : string/PyUnicode
The name of the local group.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=4096 : int
The preferred length of the data buffer.
- Search for NetGroupGetUsers at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyGROUP_USERS_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetGroupSetInfo
NetGroupSetInfo(server, groupname, level, data) Sets information about a particular group account on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
groupname : string/PyUnicode
The group name
-
level : int
The information level contained in the data
-
data : PyGROUP_INFO_*
A dictionary holding the group data.
- Search for NetGroupSetInfo at msdn, google or google groups.
win32net.NetGroupSetUsers
NetGroupSetUsers(server, group, level, members) Sets the members of a local group. Any existing members not listed are removed.
-
server : string/PyUnicode
The name of the server, or None.
-
group : string/PyUnicode
The group name
-
level : int
The level of information in the data. Must be 0
-
members : [PyGROUP_USERS_INFO_0, ..]
The list of new members
to add.
- Search for NetGroupSetUsers at msdn, google or google groups.
win32net.NetLocalGroupAdd
NetLocalGroupAdd(server, level, data) Creates a new group.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : PyLOCALGROUP_INFO_*
A dictionary holding the group data.
- Search for NetLocalGroupAdd at msdn, google or google groups.
win32net.NetLocalGroupAddMembers
NetLocalGroupAddMembers(server, group, level, members) Adds users to a local group.
-
server : string/PyUnicode
The name of the server, or None.
-
group : string/PyUnicode
The group name
-
level : int
The level of information in the data.
-
members : [PyLOCALGROUP_MEMBERS_INFO_*, ]
The new members to add.
- Search for NetLocalGroupAddMembers at msdn, google or google groups.
win32net.NetLocalGroupDel
NetLocalGroupDel(server, groupname) Deletes a group.
-
server : string/PyUnicode
The name of the server, or None.
-
groupname : string/PyUnicode
The group name
- Search for NetLocalGroupDel at msdn, google or google groups.
win32net.NetLocalGroupDelMembers
NetLocalGroupDelMembers(server, group, members) Deletes users from a local group.
-
server : string/PyUnicode
The name of the server, or None.
-
group : string/PyUnicode
The group name
-
members : [string, ...]
A list of strings with fully qualified user names to
delete from a local group.
- Search for NetLocalGroupDelMembers at msdn, google or google groups.
win32net.NetLocalGroupEnum
([dict, ...], total, resumeHandle) = NetLocalGroupEnum(server, level
, resumeHandle
, prefLen
) Enumerates all groups.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetLocalGroupEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyGROUP_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetLocalGroupGetInfo
dict = NetLocalGroupGetInfo(server, groupname
, level
) Retrieves information about a particular group on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
groupname : string/PyUnicode
The group name
-
level : int
The information level contained in the data
- Search for NetLocalGroupGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PyLOCALGROUP_INFO_*
formats, depending on the level parameter.
win32net.NetLocalGroupGetMembers
([dict, ...], total, resumeHandle) = NetLocalGroupGetMembers(server, groupName
, level
, resumeHandle
, prefLen
) Enumerates the members in a local group.
-
server : string/PyUnicode
The name of the server, or None.
-
groupName : string/PyUnicode
The name of the local group.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=4096 : int
The preferred length of the data buffer.
- Search for NetLocalGroupGetMembers at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyLOCALGROUP_MEMBERS_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetLocalGroupSetInfo
NetLocalGroupSetInfo(server, groupname, level, data) Sets information about a particular group account on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
groupname : string/PyUnicode
The group name
-
level : int
The information level contained in the data
-
data : PyLOCALGROUP_INFO_*
A dictionary holding the group data.
- Search for NetLocalGroupSetInfo at msdn, google or google groups.
win32net.NetLocalGroupSetMembers
NetLocalGroupSetMembers(server, group, level, members) Sets the members of a local group. Any existing members not listed are removed.
-
server : string/PyUnicode
The name of the server, or None.
-
group : string/PyUnicode
The group name
-
level : int
The level of information in the data.
-
members : [PyLOCALGROUP_MEMBERS_INFO_*, ..]
The list of new members to add.
- Search for NetLocalGroupSetMembers at msdn, google or google groups.
win32net.NetMessageBufferSend
NetMessageBufferSend(domain, userName, fromName, message) sends a string to a registered message alias.
-
domain : string
Specifies the name of the remote server on which the function is to execute. None or empty string the local computer.
-
userName : string
Specifies the message name to which the message buffer should be sent.
-
fromName : string
The user the message is to come from, or None for the current user.
-
message : string
The message text
- Search for NetMessageBufferSend at msdn, google or google groups.
win32net.NetMessageNameAdd
NetMessageNameAdd(server, msgname) Adds a message alias for specified machine
-
server : str/unicode
Name of server on which to execute - leading backslashes required on NT - local machine used if None
-
msgname : str/unicode
Message alias to add, 15 characters max
win32net.NetMessageNameDel
NetMessageNameDel(server, msgname) Removes a message alias for specified machine
-
server : str/unicode
Name of server on which to execute - leading backslashes required on NT - local machine used if None
-
msgname : str/unicode
Message alias to delete for specified machine
win32net.NetMessageNameEnum
NetMessageNameEnum(Server) Lists aliases for a computer
-
Server : str/unicode
Name of server on which to execute - leading backslashes required on NT - local machine used if None
win32net.NetServerComputerNameAdd
NetServerComputerNameAdd(ServerName, EmulatedDomainName, EmulatedServerName) Adds an additional network name for a server
-
ServerName : string/PyUnicode
Name of server that will receive additional name
-
EmulatedDomainName : string/PyUnicode
Domain under which to add the new server name, can be None
-
EmulatedServerName : string/PyUnicode
New network name that server will respond to
Returns none on success
win32net.NetServerComputerNameDel
NetServerComputerNameDel(ServerName, EmulatedServerName) Removes a network name added by win32net::NetServerComputerNameAdd
-
ServerName : string/PyUnicode
Name of server on which to operate
-
EmulatedServerName : string/PyUnicode
Network name to be removed
Returns none on success
win32net.NetServerDiskEnum
list = NetServerDiskEnum(server, level
) Retrieves the list of disk drives on a server.
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The level of data required. Must be 0.
- Search for NetServerDiskEnum at msdn, google or google groups.
The result is a list of drives on the server
win32net.NetServerEnum
([dict, ...], total, resumeHandle) = NetServerEnum(server, level
, type
, domain
, resumeHandle
, prefLen
) Retrieves information about each server of a particular type
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The level of data required.
-
type=SV_TYPE_ALL : int
Type of server to return - one of the SV_TYPE_* constants.
-
domain=None : string/PyUnicode
The domain to enumerate, or None for the current domain.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetServerEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PySERVER_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetServerGetInfo
dict = NetServerGetInfo(server, level
) Retrieves information about a particular server.
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The information level contained in the data
- Search for NetServerGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PySERVER_INFO_*
formats, depending on the level parameter.
win32net.NetServerSetInfo
NetServerSetInfo(server, level, data) Sets information about a particular server.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the share data.
- Search for NetServerSetInfo at msdn, google or google groups.
win32net.NetSessionDel
NetSessionDel(server, client, username) Disconnects network connections on a server
-
server : string/PyUnicode
The name of the server on which to operate, local machine assumed if None or blank
-
client=None : string/PyUnicode
Name of client computer, or None
-
username=None : string/PyUnicode
User name, or None for all connected users
Returns None on success
win32net.NetSessionEnum
(dict,...) = NetSessionEnum(level, server
, client
, username
) Returns network sessions for a server, limited to single client and/or user if specified.
-
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
Returns a sequence of dictionaries representing SESSION_INFO_* structs, depending on level specified
win32net.NetSessionGetInfo
dict = NetSessionGetInfo(level, server
, client
, username
) Returns information for a network session from specified client
-
level : int
Level of information requested, currently accepts 0, 1, 2, 10, and 502
-
server : string/PyUnicode
The name of the server on which to operate, None or blank assumes local machine
-
client : string/PyUnicode
Name of client computer
-
username : string/PyUnicode
User that established session
Returns a dictionary representing a SESSION_INFO_* struct, depending on level specified
win32net.NetShareAdd
NetShareAdd(server, level, data) Creates a new share.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data. Must be level 2 or 502.
-
data : mapping
A dictionary holding the share data, in the format of SHARE_INFO_*
- Search for NetShareAdd at msdn, google or google groups.
win32net.NetShareCheck
(ret, type) = NetShareCheck(server, deviceName
) Checks if server is sharing a device
-
server : string/PyUnicode
The name of the server, or None.
-
deviceName : string/PyUnicode
The share name
- Search for NetShareCheck at msdn, google or google groups.
The result is (1, type-of-device) if device is shared, (0, None) if it is not shared.
win32net.NetShareDel
NetShareDel(server, shareName, reserved) Deletes a share
-
server : string/PyUnicode
The name of the server, or None.
-
shareName : string/PyUnicode
The share name
-
reserved=0 : int
Must be zero.
- Search for NetShareDel at msdn, google or google groups.
win32net.NetShareEnum
([dict, ...], total, resumeHandle) = NetShareEnum(server, level
, resumeHandle
, prefLen
) Retrieves information about each shared resource on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
-
serverName
The name of the server on which the call should execute, or None for the local computer.
If the old style is used, the result is a list of [(shareName, type, remarks), ...]
- Search for NetShareEnum
param 1 is not declared as const :-( at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PySHARE_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetShareGetInfo
dict = NetShareGetInfo(server, netname
, level
) Retrieves information about a particular share on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
netname : string/PyUnicode
The network name
-
level : int
The information level contained in the data
- Search for NetShareGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PySHARE_INFO_*
formats, depending on the level parameter.
win32net.NetShareSetInfo
NetShareSetInfo(server, netname, level, data) Sets information about a particular share on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
netname : string/PyUnicode
The network name
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the share data.
- Search for NetShareSetInfo at msdn, google or google groups.
win32net.NetStatisticsGet
dict = NetStatisticsGet(server, service
, level
, options
) Retrieves network statistics for specified service on specified machine
-
server : string/PyUnicode
Name of server/workstation to retrieve statistics for (None or blank uses local).
-
service : string/PyUnicode
SERVICE_SERVER or SERVICE_WORKSTATION
-
level : int
Only 0 currently supported.
-
options : int
Must be zero.
The result is a dictionary representing a STAT_SERVER_0 or STAT_WORKSTATION_0 struct
win32net.NetUseAdd
NetUseAdd(server, level, data) Establishes connection between local or NULL device name and a shared resource through redirector
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the share data in the format of PyUSE_INFO_*.
- Search for NetUseAdd at msdn, google or google groups.
win32net.NetUseDel
NetUseDel(server, useName, forceCond) Ends connection to a shared resource.
-
server : string/PyUnicode
The name of the server, or None.
-
useName : string/PyUnicode
The share name
-
forceCond=0 : int
Level of force to use. Can be USE_FORCE or USE_NOFORCE or USE_LOTS_OF_FORCE
- Search for NetUseDel at msdn, google or google groups.
win32net.NetUseEnum
([dict, ...], total, resumeHandle) = NetUseEnum(server, level
, resumeHandle
, prefLen
) Retrieves information about transport protocols that are currently managed by the redirector
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The level of data required. Currently levels 0, 1 and
2 are supported.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetUseEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyUSE_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetUseGetInfo
dict = NetUseGetInfo(server, usename
, level
) Retrieves information about the configuration elements for a workstation
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
usename : string/PyUnicode
The name of the locally mapped resource.
-
level=0 : int
The information level contained in the data. NOTE: levels 302 and 402 don't seem to work correctly. They return error 124. So currently these info levels are not available.
- Search for NetUseGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PyUSE_INFO_*
formats, depending on the level parameter.
win32net.NetUserAdd
NetUserAdd(server, level, data) Creates a new user.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the user data in the format of PyUSER_INFO_*.
- Search for NetUserAdd at msdn, google or google groups.
win32net.NetUserChangePassword
NetUserChangePassword(server, username, oldPassword, newPassword) Changes the password for a user.
-
server : string/PyUnicode
The name of the server, or None.
-
username : string/PyUnicode
The user name, or None for the current username.
-
oldPassword : string/PyUnicode
The old password
-
newPassword : string/PyUnicode
The new password
A server or domain can be configured to require that a
user log on to change the password on a user account.
If that is the case, you need administrator or account operator access
to change the password for another user acount.
If logging on is not required, you can change the password for
any user account, so long as you know the current password.
- Search for NetUserChangePassword at msdn, google or google groups.
win32net.NetUserDel
NetUserDel(server, username) Deletes a user.
-
server : string/PyUnicode
The name of the server, or None.
-
username : string/PyUnicode
The user name
- Search for NetUserDel at msdn, google or google groups.
win32net.NetUserEnum
([dict, ...], total, resumeHandle) = NetUserEnum(server, level
, filter
, resumeHandle
, prefLen
) Enumerates all users.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The level of data required.
-
filter=win32netcon.FILTER_NORMAL_ACCOUNT : int
The types of accounts to enumerate.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetUserEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyUSER_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetUserGetGroups
[(groupName, attribute), ...] = NetUserGetGroups(serverName, userName
) Returns a list of groups,attributes for all groups for the user.
-
serverName : string
The name of the remote server on which the function is to execute. None or an empty string specifies the server program running on the local computer.
-
userName : string
The name of the user to search for in each group account.
This needs to be extended to support the new model, while
not breaking existing code. A default arg would be perfect.
Always makes the level 1 call and returns all data.
Data return format is a Python List. Each "Item"
is a tuple of (groupname, attributes). "(s,i)" respectively. In NT 4 the attributes seem to be hardcoded to 7.
Earlier version of NT have not been tested.
win32net.NetUserGetInfo
dict = NetUserGetInfo(server, username
, level
) Retrieves information about a particular user account on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
username : string/PyUnicode
The user name
-
level : int
The information level contained in the data
- Search for NetUserGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PyUSER_INFO_*
formats, depending on the level parameter.
win32net.NetUserGetLocalGroups
[groupName, ...] = NetUserGetLocalGroups(serverName, userName
, flags
) Retrieves a list of local groups to which a specified user belongs.
-
serverName : string
The name of the remote server on which the function is to execute. None or an empty string specifies the server program running on the local computer.
-
userName : string
The name of the user to search for in each group account. This parameter can be of the form <UserName>, in which case the username is expected to be found on servername. The user name can also be of the form <DomainName>\\<UserName> in which case <DomainName> is associated with servername and <UserName> is expected to be to be found on that domain.
-
flags=LG_INCLUDE_INDIRECT : int
Flags for the call.
This needs to be extended to support the new model, while
not breaking existing code. A default arg would be perfect.
win32net.NetUserModalsGet
dict = NetUserModalsGet(server, level
) Retrieves global user information on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
- Search for NetUserModalsGet at msdn, google or google groups.
The result will be a dictionary in one of the PyUSER_MODALS_INFO_*
formats, depending on the level parameter.
win32net.NetUserModalsSet
NetUserModalsSet(server, level, data) Sets global user parameters on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the data in the format of PyUSER_MODALS_INFO_*.
- Search for NetUserModalsSet at msdn, google or google groups.
win32net.NetUserSetInfo
NetUserSetInfo(server, username, level, data) Sets information about a particular user account on a server.
-
server : string/PyUnicode
The name of the server, or None.
-
username : string/PyUnicode
The user name
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the user data in the format of PyUSER_INFO_*
- Search for NetUserSetInfo at msdn, google or google groups.
win32net.NetValidateName
NetValidateName(Server, Name, NameType, Account, Password) Checks that domain/machine/workgroup name is valid for given context
-
Server : string/PyUnicode
Name of server on which to execute (None or blank uses local)
-
Name : string/PyUnicode
Machine, domain, or workgroup name to validate
-
NameType : int
Type of name to validate - from NETSETUP_NAME_TYPE enum (win32net.NetSetup*)
-
Account=None : string/PyUnicode
Account name to use while validating, current security context is used if not specified
-
Password=None : string/PyUnicode
Password for Account
If Account and Password aren't passed, current logon credentials are used
Will raise NotImplementedError if not available on this platform.
Returns none if valid, exception if not
win32net.NetValidatePasswordPolicy
NetValidatePasswordPolicy(Server, Qualifier, ValidationType, arg) Allows an application to check
password compliance against an application-provided account database and
verify that passwords meet the complexity, aging, minimum length, and
history reuse requirements of a password policy.
-
Server : string/PyUnicode
Name of server on which to execute (None or blank uses local)
-
Qualifier : None
Reserved, must be None
-
ValidationType : int
The type of password validation to perform
-
arg : dict/tuple
Depends on the ValidationType param - either
a PyNET_VALIDATE_AUTHENTICATION_INPUT_ARG, PyNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG
or PyNET_VALIDATE_PASSWORD_RESET_INPUT_ARG
tuple or dict.
Will raise NotImplementedError if not available on this platform, or
raise win32net.error if the function fails.
Returns a tuple of (PyNET_VALIDATE_PERSISTED_FIELDS, int) with
the integer being the ValidationResult.
win32net.NetWkstaGetInfo
dict = NetWkstaGetInfo(server, level
) Retrieves information about the configuration elements for a workstation
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The information level contained in the data. NOTE: levels 302 and 402 don't seem to work correctly. They return error 124. So currently these info levels are not available.
- Search for NetWkstaGetInfo at msdn, google or google groups.
The result will be a dictionary in one of the PyWKSTA_INFO_*
formats, depending on the level parameter.
win32net.NetWkstaSetInfo
NetWkstaSetInfo(server, level, data) Sets information about the configuration elements for a workstation
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the share data.
- Search for NetWkstaSetInfo at msdn, google or google groups.
win32net.NetWkstaTransportAdd
NetWkstaTransportAdd(server, level, data) binds the redirector to a transport
-
server : string/PyUnicode
The name of the server, or None.
-
level : int
The information level contained in the data
-
data : mapping
A dictionary holding the share data.
- Search for NetWkstaTransportAdd at msdn, google or google groups.
win32net.NetWkstaTransportDel
NetWkstaTransportDel(server, TransportName, ucond) unbinds the transport protocol from redirector
-
server : string/PyUnicode
The name of the server, or None.
-
TransportName : string/PyUnicode
The name of the transport to delete.
-
ucond=0 : int
Level of force to use. Can be USE_FORCE or USE_NOFORCE or USE_LOTS_OF_FORCE
- Search for NetWkstaTransportDel at msdn, google or google groups.
win32net.NetWkstaTransportEnum
([dict, ...], total, resumeHandle) = NetWkstaTransportEnum(server, level
, resumeHandle
, prefLen
) Retrieves information about transport protocols that are currently managed by the redirector
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetWkstaTransportEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyWKSTA_TRANSPORT_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.
win32net.NetWkstaUserEnum
([dict, ...], total, resumeHandle) = NetWkstaUserEnum(server, level
, resumeHandle
, prefLen
) Retrieves information about all users currently logged on to the workstation.
-
server : string/PyUnicode
The name of the server to execute on, or None.
-
level : int
The level of data required.
-
resumeHandle=0 : int
A resume handle. See the return description for more information.
-
prefLen=MAX_PREFERRED_LENGTH : int
The preferred length of the data buffer.
- Search for NetWkstaUserEnum at msdn, google or google groups.
The result is a list of items read (with each item being a dictionary of format
PyWKSTA_USER_INFO_*, depending on the level parameter),
the total available, and a new "resume handle". The first time you call
this function, you should pass zero for the resume handle. If more data
is available than what was returned, a new non-zero resume handle will be
returned, which can be used to call the function again to fetch more data.
This process may repeat, each time with a new resume handle, until zero is
returned for the new handle, indicating all the data has been read.