cancel
Showing results for 
Search instead for 
Did you mean: 

How to get all users from the server....?

Former Member
0 Kudos

Hi all,

in my application i want to get all possible users present in the PORTAL-EP Server

and set them into the drop down.

is there need to login in the portal as a admin or other user to get the all users present in the Server.

Regards,

Deepak

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos
Former Member
0 Kudos

Hi! Deepak,

you can use UME API to get all the users of EP in WebDynpro appl.

Herewith i am giving you the UME API link --

<a href="http://help.sap.com/javadocs/NW04/current/um/index.html">http://help.sap.com/javadocs/NW04/current/um/index.html</a>

i am giving the code also to get all the users from LDAP.


   IPublic<ComponentName>.IUserIDElement userIDNodeElement = null;
 IUserAccountFactory accountFact = UMFactory.getUserAccountFactory();
 MessageManager msgMgr = (MessageManager)wdThis.wdGetAPI().getComponent().getMessageManager();
	 
try {	
IUserAccountSearchFilter accountSearchFilter  =  accountFact.getUserAccountSearchFilter();
accountSearchFilter.setLogonUid("*",ISearchAttribute.LIKE_OPERATOR,false);
ISearchResult srchRslt = accountFact.search(accountSearchFilter);
			
   while(srchRslt.hasNext()) {				
                userIDNodeElement = wdContext.createUserIDElement();		String uniqueID = (String)srchRslt.next();
	IUserAccount userAccount = accountFact.getUserAccount(uniqueID);
	String LogonUid = userAccount.getLogonUid();
	userIDNodeElement.setCtx_UserID(LogonUid);
	wdContext.nodeUserID().addElement(userIDNodeElement);

    } catch(Exception exc) {
	         msgMgr.reportWarning(umException.toString());
   }
 

regards,

Mithilehwar

Former Member
0 Kudos

Hi,

Try this thread,

Regards,

Balaji P.J

Former Member
0 Kudos

Hi Deepak

Try this code.

IPortalComponentResponse response = (IPortalComponentResponse) this.getResponse();

try {

IUserFactory userFactory = UMFactory.getUserFactory();

IUserSearchFilter searchFilter = userFactory.getUserSearchFilter();

ISearchResult searchResult = userFactory.searchUsers(searchFilter);

while (searchResult.hasNext()) {

String uniqueid = (String) searchResult.next();

IUser user = userFactory.getUser(uniqueid);

response.write(user.getUniqueName() + "<br>");

}

} catch (Exception e) {

response.write(e.getMessage());

}

You can also use this code

IGroup group_Portal_Everyone = UMFactory.getGroupFactory().getGroupByUniqueName("Everyone");

Users_Portal_Everyone = group_Portal_Everyone.getUserMembers(true);

Thanks and regards

Sivaprasath

Message was edited by:

Armin Reichert