I done the coding to get the one system information that are under the current domain.
I want to read all the system information under the same domain,.,
How can i read those information..
My coding:
#include "stdafx.h"
#include <windows.h>
#include <lm.h>
int main(int argc, char* argv[])
{
DWORD dwLevel = 101;
DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
LPSERVER_INFO_101 pBuf = NULL;
DWORD dwEntriesRead = 0;
DWORD dwTotalEntries = 0;
DWORD dwServerType = SV_TYPE_SERVER;
LPTSTR pszDomainName = NULL;
DWORD dwResumeHandle = 0;
NET_API_STATUS nStatus;
nStatus = NetServerEnum(NULL,
dwLevel,
(LPBYTE *) & pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries,
dwServerType,
pszDomainName,
&dwResumeHandle);
if(nStatus == NERR_Success)
{
printf("\n\nSucess\n");
printf("The total entires is %d\n\n",dwEntriesRead);
char szBuf[200] = {0};
sprintf( szBuf, "%S", pBuf->sv101_name );
printf("The server name %s\n",szBuf);
printf("The serve type %d\n",pBuf->sv101_type);
printf("\nThe server major version is %d",pBuf(->sv101_version_major);
printf("\nThe server minor version is %d",pBuf->sv101_version_minor);
}
else
{
printf("\nError\n");
}
return 0;
}