SOL9 Sample: NetUserGroup

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * NetUserGroup.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#include <sol/nm/NetUser.h>

#include <sol/nm/UserInfo0.h>
#include <sol/nm/GroupInfo0.h>

#include <sol/Locale.h>

void _tmain(int argc, TCHAR** argv)
{
  Locale locale;

  try {
    wchar_t* server = NULL;

    NetUser netUser(server);

    UserInfo0  user0;

    GroupInfo0 ginfo0;

    netUser.enumerateAll(user0);
    USER_INFO_0* ptr = user0.getInfo();
    int count = user0.getEntriesRead();
    printf("USER_INFO_0 count=%d\n", count);
    for (int i = 0; i<count; i++) {
      if (ptr) {
        printf("UserName: %S\n", ptr->usri0_name);

        netUser.getGroups(ptr->usri0_name, ginfo0);
        ginfo0.display();
      }
      ptr++;    
    }

  } catch (...) {
    printf("Exception \n");
  }

  printf("OK. Please hit [enter] key\n");
  getchar();
}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.