How to retrieve all users in the portal with UME API

Hi everybody,
I would like to know how to retrieve all the users from a portal, which uses LDAP as a source (there are users created in the portal as well)
My code snippet is :
IUserFactory userFactory = UMFactory.getUserFactory();
UserSearchFilter searchFilter = userFactory.getUserSearchFilter();
searchFilter.setDisplayName("*", ISearchAttribute.LIKE_OPERATOR, false);
ISearchResult searchResult = userFactory.searchUsers(searchFilter);
My problem is that with the code above, only the users created in the portal are displayed, and no LDAP users.
Does someone know how to retrieve all the users whatever is the source?
Regards
Renaud

prakash's code should work.
however, mine code below doesn't user a search filter. it retrieves everyuser including users like indexadmin etc. Note:
result.next().toString();
returns a weird uniqueID used in the portal world.
getUniqueName()
gives your the usernames (sAMAccountName in Microsoft AD) people use to logon to the portal.
try {
  IUserFactory uf = UMFactory.getUserFactory();
  ISearchResult result = uf.getUniqueIDs();
  while (result.hasNext()) {
    String uniqueid = result.next().toString();
    IUser user = uf.getUser(uniqueid);
    String userid = user.getUniqueName();
} catch(Exception e) {
  //systemout

Similar Messages

  • Using Powershell to delete all users from the Portal

    Summary
    This script will delete all users from the Portal except for Administrator and the Built-In Sync account.
    Based on Markus's "Delete a User" script.
    Useful when developing your system if you want to quickly clear out the data and start again.
    set-variable -name URI -value "http://localhost:5725/resourcemanagementservice' " -option constant
    function DeleteObject
    PARAM($objectType, $objectId)
    END
    $importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
    $importObject.ObjectType = $objectType
    $importObject.TargetObjectIdentifier = $objectId
    $importObject.SourceObjectIdentifier = $objectId
    $importObject.State = 2
    $importObject | Import-FIMConfig -uri $URI
    if(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation}
    $allobjects = export-fimconfig -uri $URI `
    –onlyBaseResources `
    -customconfig "/Person"
    $allobjects | Foreach-Object {
    $displayName = $_.ResourceManagementObject.ResourceManagementAttributes | `
    Where-Object {$_.AttributeName -eq "DisplayName"}
    if([string]::Compare($displayName.Value, "Administrator", $True) -eq 0)
    {write-host "Administrator NOT deleted"}
    elseif([string]::Compare($displayName.Value, "Built-in Synchronization Account", $True) -eq 0)
    {write-host "Built-in Synchronization Account NOT deleted"}
    else {
    $objectId = (($_.ResourceManagementObject.ObjectIdentifier).split(":"))[2]
    DeleteObject -objectType "Person" `
    -objectId $objectId
    write-host "`nObject deleted`n" $displayName.Value }
    Go to the FIM ScriptBox
    http://www.wapshere.com/missmiis

    The DeleteObject function opens and closes a connection for each object.  This approach is faster:
    http://social.technet.microsoft.com/wiki/contents/articles/23570.how-to-use-powershell-to-delete-fim-users-that-have-a-null-attribute-name.aspx
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

  • How to retrieve all users in a specific group

    Hi,
    I am using SunOne directory server. Can someone please post a sample code that illustrates how to fetch all the list of users in a particular group.
    1) Let's say I want to find all the users in a group called "marketing". The root context is dc=mycompany,dc=com This group can be anywhere below this root context. Only information I am told is the name of the group - "marketing". How will I get all the users in this group?
    2) For each user that is retrieved from the group marketing, how will I find out the user's DN?
    Thanks for the help,
    - Satish

    Do it like this...
    String searchBase = "ou=marketing";
    StringBuffer filter = new StringBuffer();
    filter.append("(|");
    if (organizationName != null && !organizationName.trim().equals("")) {
         filter.append("(");
         filter.append(ou);
         filter.append("=");
         filter.append("marketing");
         filter.append(")");
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    constraints.setCountLimit(200); // How many users should be found
    constraints.setTimeLimit(100000); // how much time should this search wait
    // Get a initial context and set it to the ctx object
    ctx.search(searchBase, filter.toString(), constraints);

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

    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

    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

  • How to make all users have the same working environment?

    Hi guys,
    thanks for helping out on this issue.
    Is there a way to set all users on your system to have the same working environment? I believe, as root you can edit the /etc/profile. But when I looked at the file, I was confused. I had no idea where to add stuff because it was a script.
    Please if anyone can help me explain how to customize system wide working environments, I will be very grateful .
    Thank you
    Arrey

    Hi.
    It's not clear what you understand under system wide working environments ?
    /etc/profile it's one possible solution.
    Another way - put custimozed .profile to all users and use customezed */etc/skel* for new users.
    Regards.

  • HT1660 how can I use one single library for all users on the same laptop?

    how can I use one single library for all users on the same laptop?

    You are most of the way there. Each user having access to hard drive is the key. If users are limited in file privileges this is harder.
    Any files you add to your library and any files she adds to her library are available to the other. Just not automatically. Each user must add the files to their own library using the add file or add folder option from menu bar.
    What I have done is set library location to a location outside of My Documents\My Music. On my network storage I have a folder names s:\itunes. Both accounts iTunes are set to use this location for the library.

  • How to view a BI query with anonymous user in the portal

    <b>Hi Gurus,</b>
    Does anybody knows how to view a BI query in the portal with anonymous user?
    Cause when i try to view a query the portal always ask for authentification. And i don't want to sign with a user cause my portal is for everybody and if the user logged in it shows the roles that previously were assigned.
    I have the Netweaver 2004 with SP9
    <b>Thank you Very Much</b>

    do you have sso configured between portal and BW server, if yes the authentication pop up should not come.
    if you dont want to do sso between portal and bw server and still want to logon to BW query with anonymous user,
    in you bw server go to transaction sicf and navigate to DEFAULT_HOST->SAP->BW->BEX and double click on bex node in the resulting window, log on details section provide a default userid/password
    Raja

  • How to see all users who are allowed permissions for the specified entity ?

    How to see all users who are allowed permissions for the specified entity ? 
    And change user permissions for the current entity
    from Moscow with money

    Vincent,
    ... and how to change entity permissions for some users?
    from Moscow with money

  • How to show all user logged in/loggout in Report

    How to display All User Logged in time & Logout Time?
    Hi..
    I want to display All user in Portlet a report that show us all user that logged in the portal,
    their username,
    their time logged in,
    their time logged out..
    where can i find these information?
    do Portal have already something like this?
    Plz advise..Thanks.

    Thanks Sharmila for answering my question..
    Similar question i want to ask..
    I look at the table, and view it's data...
    Mmm..some i don't recognize...
    Actually, i just want to grep
    1)The UserId of the user who logged in the portal
    2)The time he logged in the portal
    3)the time he log out the portal
    That's all..
    How can i do that?..
    I plan to create one table to store the data, and plan to grab the data by jsp....
    What are the table/function/api that can i use and how?
    Plz advise.
    Thanks

  • How to display All User Logged in time & Logout Time?

    How to display All User Logged in time & Logout Time?
    Hi..
    I want to display All user who logged in the portal,
    their username,
    their time logged in,
    their time logged out..
    where can i find these information?
    do Portal have already something like this?
    Plz advise..Thanks.

    The login information is in the wwlog_activity_log. The logout action is only logged when it is explicit. I am using the last user action time for the logout time so I can determine the duration of the visit.

  • How to restrice ananymous user access to portal link /irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.portallauncher.default?

    Hi experts,
    We had an issue with portal access. I wonder if portal is venerable for security threats?
    Could you please let me how to restrict the unauthorized users (anonymous user) to the portal URL.
    https://HOST:50001//irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.portallauncher.default .
    Appreciate your help.
    Regards
    Maruti

    Hi Maruti,
    Hope you are doing good.
    Can't you just amend the portal permissions so that this access is not possible.
    The PCD location should be:
    com.sap.portal.system/security/sap.com/NetWeaver.Portal/no_safety/com.sap.portal.navigation.portallauncher....
    Hope this helps.
    Thank you and have a nice day!
    Kind Regards,
    Hemanth

  • How to get all users under an organizations?

    Hello everyone.
    Just want to know if anyone knows how to get all users under a particular organization.
    From the Search User form, I found they may kind of user such attribute conditions:
    MemberObjectGroup
    is in
    XXXX(organization)
    But unfortunately, the "is in" is not a valid AttributeConditionOperator, so besides using "recursive" self-written function, anyone knows any possible buit-in trick?

    Here is my solution:
    <Rule'>
        <RuleArgument name='organization'/>
        <RuleArgument name='context'/>
        <block>
            <defvar name='orgs'>
                <new class='java.util.ArrayList'/>
            </defvar>
            <invoke name='getChildObjectGroupNames'>
                <invoke name='getObject' class='com.waveset.ui.FormUtil'>
                    <ref>context</ref>
                    <s>ObjectGroup</s>
                    <ref>organization</ref>
                </invoke>
                <ref>orgs</ref>
            </invoke>
            <append name='orgs'>
                <ref>organization</ref>
            </append>
            <invoke name='getUsers' class='com.waveset.ui.FormUtil'>
                <ref>context</ref>
                <map>
                    <s>conditions</s>
                    <list>
                        <new class='com.waveset.object.AttributeCondition'>
                            <s>MemberObjectGroups</s>
                            <s>in</s>
                            <ref>orgs</ref>
                        </new>
                    </list>
                </map>
            </invoke>
        </block>
        <MemberObjectGroups>
            <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
        </MemberObjectGroups>
    </Rule>

  • How to retrieve all BAPIs through JCo

    Hi All,
    i'm currently using JCo to access an SAP server, and just wondering if there's a method to retrieve all BAPIs from the server. From the available online documents, i can only see methods that returns a specific BAPI with a given function name.
    If we can't get all BAPIs through JCo, whether there're some system BAPIs that i can call on to process the searching? just like sys procedure in database's context.
    Any helps are highly appreciated. Thanks

    Well, the Repository seems to only expose methods like
    getFunctionInterface() & queryFunctionInterface(), both of which certainly don't serve my needs.
    The reason why i expect JCo has such built-in "retrieving all func names" services is because i saw some tooling applications, purely written in Java, developed navigator to display all BAPIs of a SAP. I mean it could be some button say "search all BAPIs", and when the user gestures to hit that button, it just populates all BAPIs returned from server.
    While since i can't find such methods from the JCO doc, does it mean it can't be achieved through JCo?

  • How to retrieve all fields from Entiy Bean

    Is there a simpler way to retrieve all fields from the entity bean than calling each individual get method?
    I need to retrieve the entire record not the contents of the entire table.
    Though, I may eventually need to do that also.
    I have 56 fields on this table. It does not make sense to code a get statement for every field.
    If you can direct me to sample code that would be good.
    Also, are there any good examples out there of how to create an entity bean or session bean using a local interface?
    Thanks,
    Jim

    I think you are confusing an EJB with a DAO.
    If you want to access the database why not just use JDBC?

  • You do not have sufficient privileges to complete this installation for all users of the machine. Log on as administrator and then retry this installation

    Hi all
    Have seen a couple threads regarding this but unfortunately nothing that solves my problem thus far!
    Right now, our developers are using the Domain Admin account to promote their website code using MSI files.  I'd like to change this as I feel the Domain Admin account should be on lock down and only used when absolutely necessary, pretty common.  The
    same goes for my account too, I would like to absolve as much use of the Domain Admin as I can.
    Problem is, when they run installers from their own accounts, they receive this error: You do not have sufficient privileges
    to complete this installation for all users of the machine. Log on as administrator and then retry this installation
    The accounts they are using are part of the Built In Administrators group and the Domain Admins group... I'm not sure what other permission you'd need in a domain?  We've gone as far as explicitly giving them local admin access on this server and still
    nothing changes.
    Is there a Group Policy or something that I can change to provide install rights and possibly remove these accounts as Domain Admin and more along the line of Power User?
    Thanks much for your help!
    Ryan

    Hi,
    You could use Software Restriction Policies (SRP’s) or Applocker(supported on Windows server 2008 R2/Windows 7 only) to restrict the running
    of the application for specific user.
    Description of the Software Restriction Policies
    http://support.microsoft.com/kb/310791
    HOW TO: Restrict Users from Running Specific Windows Programs
    http://support.microsoft.com/kb/323525
    How to Implement Group Policy Security Filtering
    http://www.windowsnetworking.com/articles_tutorials/Group-Policy-Security-Filtering.htmlPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Maybe you are looking for