Using Win32 functions in Visual FoxPro Image Gallery
Network Management
..msdn
NetApiBufferFree
NetApiBufferSize
NetConnectionEnum
NetFileClose
NetFileEnum
NetFileGetInfo
NetGetDCName
NetGroupEnum
NetLocalGroupEnum
NetMessageBufferSend
NetMessageNameAdd
NetMessageNameDel
NetMessageNameEnum
NetScheduleJobAdd
NetScheduleJobDel
NetScheduleJobEnum
NetServerEnum
NetServerGetInfo
NetSessionEnum
NetShareAdd
NetShareDel
NetShareEnum
NetShareSetInfo
NetUserAdd
NetUserChangePassword
NetUserDel
NetUserEnum
NetUserGetGroups
NetUserGetInfo
NetUserGetLocalGroups
NetUserSetInfo
NetWkstaGetInfo
NetWkstaTransportEnum
NetWkstaUserEnum
Code examples:
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
NetServerEnum
..msdn    Add comment     W32 Constants      Translate this page
Lists all servers of the specified type that are visible in a domain.
Code examples:
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
Declaration:
NET_API_STATUS NetServerEnum(
  LPCWSTR servername,
  DWORD level,
  LPBYTE *bufptr,
  DWORD prefmaxlen,
  LPDWORD entriesread,
  LPDWORD totalentries,
  DWORD servertype,
  LPCWSTR domain,
  LPDWORD resume_handle
);
FoxPro declaration:
DECLARE INTEGER NetServerEnum IN netapi32;
    INTEGER   servername,;
    INTEGER   level,;
    INTEGER @ bufptr,;
    INTEGER   prefmaxlen,;
    INTEGER @ entriesread,;
    INTEGER @ totalentries,;
    INTEGER   servertype,;
    STRING    domain,;
    INTEGER   resume_handle
Parameters:
servername
[in] Reserved; must be NULL.

level
[in] Specifies the information level of the data.

bufptr
[out] Pointer to the buffer that receives the data.

prefmaxlen
[in] Specifies the preferred maximum length of returned data, in bytes.

entriesread
[out] Pointer to a DWORD value that receives the count of elements actually enumerated.

totalentries
[out] Pointer to a DWORD value that receives the total number of visible servers and workstations on the network.

servertype
[in] Specifies a DWORD value that filters the server entries to return from the enumeration.
domain
[in] Pointer to a constant Unicode string specifying the name of the domain for which a list of servers is to be returned.

resume_handle
Reserved; must be set to zero.
Return value:
If the function succeeds, the return value is NERR_Success (0).
My comment:
For example, an application can call NetServerEnum to list all domain controllers only or all SQL servers only. You can combine bit masks to list several types. For example, a value of 0x00000003 combines the bit masks for SV_TYPE_WORKSTATION (0x00000001) and SV_TYPE_SERVER (0x00000002).

The buffer within this function is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA.

If you require more information for a specific server, call the WNetEnumResource function.

Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Unsupported.
Word Index links for the NetServerEnum :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-10-15 20:15:24
Modified: 2001-11-26 16:03:46
Visited in last 7 days: 34
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.147.40.153)
9 sec.Function: 'WaitForSingleObject'
19 sec.Links
29 sec.Function: 'NetGroupEnum'
Function group: 'Network Management'
39 sec.Function: 'CeSetFilePointer'
Function group: 'Remote Application Programming (RAPI)'
50 sec.
Function group: 'Menu'
1.02 min.Function: 'NetServerGetInfo'
Function group: 'Network Management'
1.18 min.Function: 'GetEnvironmentStrings'
1.33 min.
Function group: 'Windows Multimedia'
1.53 min.Function: 'CeRapiInvoke'
Function group: 'Remote Application Programming (RAPI)'
1.72 min.Function: 'CeRemoveDirectory'
Function group: 'Remote Application Programming (RAPI)'
Google
Advertise here!