1

I'm developing IBM AS400 Client Access Software. I'm trying to get Sign on User List. there are have more than 70 sign on Users, but my code give me only 6 User Details. Can anyone help me to do this Friends..

My Code :

try {
         AS400 system = new AS400 ("SERVER","USER", "PASSWORD");
         UserList userList = new UserList(system);
         Enumeration list = userList.getUsers();

      while (list.hasMoreElements())  {
      User U = (User) list.nextElement();

      long UID = U.getUserID();
      String SUID = Long.toString(UID);

      String DESCRIPTION = U.getDescription();
      int USD_STORAGE = U.getStorageUsed();
      String USD_S = Integer.toString(USD_STORAGE);
      String COUNTRY_ID = U.getCountryID();
      String JOB_DESCRIPTION = U.getJobDescription();
      String STATUS = U.getStatus();

String[] JOBDATA = {SUID,DESCRIPTION,USD_S,COUNTRY_ID,JOB_DESCRIPTION,STATUS};
DTM.addRow(JOBDATA);


}
} catch (Exception e) {
       e.printStackTrace();
}
Dzshean
  • 314
  • 6
  • 23
  • 1) Change `} catch (Exception e) { System.out.println(e);` to `} catch (Exception e) { e.printStackTrace();` & copy/paste the output as an [edit to the question](http://stackoverflow.com/posts/16163784/edit). 2) Use a consistent and logical indent for code blocks. The indentation of the code is intended to help people understand the program flow. – Andrew Thompson Apr 23 '13 at 07:53
  • @ Andrew - friend - i add that code to Exception. but no any Exception printed. It give 6 user details only. but there have 76 sign on users – Dzshean Apr 23 '13 at 08:01
  • The correct term for an account on this platform is User Profile. Your use of the term Sign on Users might imply to some that you seek a list of users currently logged in. – WarrenT Apr 23 '13 at 23:34

1 Answers1

4

System security usually restricts who can view user profile information. "USER" must have the proper authority.

Buck Calabro
  • 7,558
  • 22
  • 25
  • 1
    You would have to request proper authority from a system security administrator on that system. If you are unfamiliar with the environment, then you may be unlikely to get that level of authority. Enumeration of users is a security issue that auditors pay attention to. – WarrenT Apr 23 '13 at 23:37
  • 1
    Check your rights to the users you can't see ... if you don't have at least *USE authority those profiles, you won't be able to see them. – David G Apr 24 '13 at 14:57
  • 1
    Not only will those user profiles not be shown, but also there should be no AS400SecurityException for simply creating a UserList. An exception should only be thrown if one of the restricted User objects is (attempted to be) accessed. – user2338816 Mar 22 '14 at 00:31