Sample Code to check AD User Status

Gurus,
I want to check status of ADUser using Java Code , request you to please share any code snippet.
Thanks.
Edited by: OIMAndMe on Jan 2, 2013 11:00 PM

get the below one for sample code
http://www.myjeeva.com/2012/05/querying-active-directory-using-java/
Querying deleted objects container in Active Directory using JNDI
there is no such status attribute in ad but you have to get the userAccountControl attribute for same. add the userAccountControl in the returnAttribute and then decode it (for example,if the value of userAccountControl =512 means Enable)

Similar Messages

  • Need help with API and sample code for checking a user's rights on a folder

    Hi All,
    I am working on an UCM integration where user supplies a folderpath (ucm folders), and a file is later uploaded to this location.
    Since a user can provide a folderpath where he has only Read Access or no access at all, we are trying to work out a way to pre-check his permissions on the folder.
    Since we have Entity Security enabled, we have 5 security fields to rely on Account, Security Group, User Access List, Group Access List, Role Access List.
    Writing custom code for this security check is second on our agenda.
    Firstly, we wish to know the API and sample code that typically performs this Security Check in UCM.
    We could find intradoc.shared.SecurityUtils which has methods to check security on SGroup and Account, but we couldn't find anything for:
    1) Overall security check
    2) ACL security check on top of sgroup and account security check

    Any ideas anyone?!
    I am looking forward to some pointers here. :(

  • A sample code to check records of a system table?

    hi ABAP4 experts,
    We are pretty new at ABAP4.  We would be appreciated if you can provide a sample code to check how many records and calculate a total amount for a specific field, e.g., DMBTR in a system table, e.g., BSEG.  Note: there is no any selection for this table BSEG, we just want to get the total record count in this table and also the total amount for a specific field e.g. DMBTR in this table.
    Do we have to use an internal table to transfer all the records of BSEG into the internal table to get the result?
    We will give you reward points!

    Hi Kevin,
    Using SUM directly in SQL will NOT work for table BSEG because BSEG is pool table. You will get an ABAP error.
    "Aggregate functions and the addition DISTINCT are not supported in field lists for pooled and cluster tables".
    You need an internal table to transfer all data from BSEG and perform calculation for count and sum.
    Concerning about performance running perhaps you can code something like this.
    REPORT ZZFLTEST NO STANDARD PAGE HEADING.
    TABLES: BSEG.
    DATA: CURS          TYPE CURSOR,
          PACKAGE_SIZE  LIKE RMCS4-MC_CM_PSIZE VALUE '10000'.                                                                               
    DATA: BEGIN OF I_BSEG OCCURS 0,
            BELNR TYPE BSEG-BELNR,
            BURKS TYPE BSEG-BURKS,
            GJAHR TYPE BSEG-GJAHR,       
            BUZEI TYPE BSEG-BUZEI,       
            DMBTR TYPE BSEG-DMBTR,
            SHKZG TYPE BSEG-SHKZG.
    DATA: END OF I_BSEG.
    DATA: TOT_DMBTR TYPE BSEG-DMBTR,
          TOT_REC   TYPE I.
    SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS: P_SIZE LIKE RMCS4-MC_CM_PSIZE DEFAULT '10000'.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK B01.
    START-OF-SELECTION.
      PACKAGE_SIZE = P_SIZE.
      OPEN CURSOR WITH HOLD CURS FOR
      SELECT BELNR BURKS GJAHR BUZEI DMBTR SHKZG
      FROM BSEG
      WHERE BELNR <> SPACE
        AND BURKS <> SPACE
        AND GJAHR <> SPACE
        AND BUZEI <> SPACE.
    *Fetch internal table I_BSEG for every 10000 records.
      DO.
        FETCH NEXT CURSOR CURS
        INTO TABLE I_BSEG PACKAGE SIZE PACKAGE_SIZE.
        IF SY-SUBRC <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE CURSOR CURS.
      LOOP AT I_BSEG.
        TOT_REC = TOT_REC + 1.
        IF I_BSEG-SHKZG = 'S'.
          TOT_DMBTR = TOT_DMBRT + I_BSEG-DMBTR * -1.
        ELSE.
          TOT_DMBTR = TOT_DMBTR + I_BSEG-DMBTR.
        ENDIF.
      ENDLOOP.
      WRITE: / 'TOTAL BSEG-DMBTR:', TOT_DMBTR,
             / 'TOTAL RECORD:    ', TOT_REC.
    END-OF-SELECTION.
    Hope this will help.
    Regards,
    Ferry Lianto

  • Sample code to check whether a particular resource is provisioned in OIM11g

    Hi,
    I would like to check whether AD resource is provisioned or not for a given user. If so, I would like to add a group to it.
    Can you please provide me some sample code for this scenario. I am using oim 11g.

    Hi
    Here is some sample code:
    tcResultSet userSet = userAPI.findUsers(userSearchMap);
                   if (userSet.getRowCount() <= 0) {
                        System.out.println("User not found in OIM:-" + userID);
                        continue;
                   userSet.goToRow(0);
                   long userKey = userSet.getLongValue("Users.Key");
                   tcResultSet userObjSet = userAPI.getObjects(userKey);
                   for (int i = 0; i < userObjSet.getRowCount(); i++) {
                        userObjSet.goToRow(i);
                        if (roName.equalsIgnoreCase(userObjSet
                                  .getStringValue("Objects.Name"))) {
                             objStatus = userObjSet
                                       .getStringValue("Objects.Object Status.Status");
                             long oiu_key = userObjSet
                                       .getLongValue("Object Instance.Key");
                             if (!("Provisioned".equalsIgnoreCase(objStatus)
                                       || "Disabled".equalsIgnoreCase(objStatus) || "Enabled"
                                       .equalsIgnoreCase(objStatus))) {
                                  continue;
    Regards
    user12841694

  • Sample code  ale/idoc n user exits

    Hi
    could any one post me two objects each for ALE/IDOCs and Enhancements with explanation about business scenarios ,complete code plz....

    I do not see any FM idoc_input_deladv1   ,but i see FM IDOC_INPUT_DELVRY
    There are user exits related to FM IDOC_INPUT_DELVRY
    Check the enhancement : V55K0001
    FM : EXIT_SAPLV55K_001
    Check the enhancement : V55K0002
    EXIT_SAPLV55K_002
    Check the enhancement : V55K0003
    EXIT_SAPLV55K_003
    Thanks
    Seshu

  • User Status update on Header and Item in Sales Order

    Hi,
    I need to update the user status in both the header and Item based on some conditions. I checked the user exit's under 'MV45AFZZ' but no use.
    Could any one please provide me where I can write the code to upate user status in header and Item.
    Thanks
    Srihari.
    Edited by: SrihariKonduru on Dec 23, 2009 4:21 PM

    Hi,
    Thanks for quick reply.
    But I think this will be updated the satus using a report program. But in my case if the user creates a sales order or he is in change mode based on the selection of Distribution channels and Dunning key's I need to update the satus.
    For this I need a exit to write the code. And also I required sample code snippet to update the status in user exit. If that availble it will be great help to me.
    Thanks
    Srihari.

  • Controlling system statuses in user status

    My 1st question is user status is assigned to master data or transactional data?
    Once User status is set as "Completed" after order TECO, can we  set that business transaction "Revoke Technical completion"
    can not be carried out (Forbidden) in this user status ?
    Suppose after time confirmation I want to use some user status and then do the teco,is it possible and how to do it?
    Where is the authorization code used in the user status defined?

    1) Is user status is assigned to master data or transactional data? It can be both
    2) Once User status is set as "Completed" after order TECO, can we set that business transaction "Revoke Technical completion"
    can not be carried out (Forbidden) in this user status ? Have a look in TCode OIBS to check
    3) Suppose after time confirmation I want to use some user status and then do the teco,is it possible and how to do it? You can set user and system statuses independent of each other
    4) Where is the authorization code used in the user status defined? Have a look in TCode OIBS
    PeteA

  • Reg : User status information is not updating in Cube

    Hi Experts,
    I am loading data to INfocube which gets data from sales order ODS and Master data infoobject PROJECT which has project  code. User status is a attribute fo Project (Master data infoobject). 1 WEEK before user staus was changed for a particular Project code in source system ECC system .If i display data in Master data PROJECT ,I could able to see changed user staus for that particular Project code.
    Later data loaded to cube from Master data and ODS.If I select a particular Project code and give a sales document number and try to see user status which got changed ,it is not showing changed User status and values are not showing in Infocube.But when i try for another project code its showing correct User status in INfocube.
    Kindly guide me to solve this issue.
    Thanks in advance!

    ACR for Master data load was happend already and we can able to see changed user status in Master data.
    But we are unable to view user status ,SALES document values for that particular project code. Sales document is extracting from ods.

  • Revenue Recognition based on User Status of assigned Sales Order line item

    Dear Community members,
    We have requirement to recognize / de-recognize revenue posted to WBS for calculation of RA, based on the 'User status' of the assigned Sales Order line item.
    To elaborate requirement further -
    1) WBS Element - XXX - 10 ( with operative indicator - Plan/Bill/Account Assign)
    2) Sales Order(SO) Line Items assigned to the above WBS -
    - SO No -  123 Line Item 10 - Actual Rev - $ 300 - User Status - EXE (Meaning this work is in progress , partial payment received thus actual revenue for RA at WBS is 'Zero'
    - SO No -  124 Line Item 20 - Actual Rev - $ 400 - User Status - COMPL(Meaning this work is Complete , all payment received thus actual revenue for RA at WBS is $400
    - SO No -  125 Line Item 10 - Actual Rev - $ 800 - User Status - EXE (Meaning this work is in progress , partial payment received thus actual revenue for RA at WBS is 'Zero'
    As per WBS reports Actual Revenue posted to WBS XXX-10 is $ 1500 ( $300$400$800) , however since two SO line items ( SO 123 /line item 10 and SO 125 / line Item 10 ) are NOT having User status 'COMPLETE', the actual revenue posted by those line items $ 1100/- ($300 + 800)  should not be included as Actual Revenue for RA at WBS level.
    Thus Actual Revenue for RA at WBS XXX-10 should be $ 400 /- ( the revenue posted by SO 124/line item 20 which has user status as 'COMPLETE')
    How do above can be achieved?? Is there any standard solution for this?? Is any SAP Note available for this (I too am looking for one but not found any ) ?? do we need any enhancement , Customer exit etc
    Thanks in advance
    with regards

    Hi,
    Thanks. You are right that the 'Completed Contract Method' would defer revenue recognition. However, the status checked would be of the RA object (WBS Element in this case, as RA key is on WBS and RA is being calculated on the WBS).
    However, our requirement is to check the user status of the Sales Order Line items assigned to the WBS element and filter the revenues posted based on the active user status of individual Sales Order Line item.
    Please give you inputs.
    Thanks in advance
    With regards

  • CRM Incompleteness Check dependent on status

    Dear Experts,
    I am working on a status scheme that requires to perform incompleteness checks depending on user status.
    So far the check simply runs on document type levels (Quotation & Order).
    We thought about triggering this problem using the "Action Wizard", however we cannot find the merge between Incompleteness Check & Action.
    Does anyone have an idea how to combine incompleteness checks with user status?
    Thanks a lot for your help!
    Daniel

    Hi Daniel,
    Here is some information regarding your old question
    - if you still need it
    As standard function, Incompletness can trigger Business
    Transaction which is link to System status (tcode BS33).
    But this only relevant if you use CRM Activity.
    In order to check user status to run specific incompletness check, you have to write BAdi Implementation
    after you complete the Incompletness Configuration.
    Or another way, create modification in BAdi-Order Save
    for the validation and Set Action to be run in When
    Saving time.
    Hope this could help.
    Cheers,
    Gun.

  • ISSUE IN USER STATUS IN WCD IN WCM

    Hi experts ,
    i am facing an issue in wcd(work clearance document). i set user status and when that user status  is active user is unable to do untagging, temporarily untagging. but due to some issue i deleted that user status and assign again. but after deletion when i create same user status with same checks system does not perform checks, it allows user to do untagging when that is active. please help me i am stucked very badly and not able to go ahead.

    hi sebastian,
    thanks for reply
    in my business scenarion tagging and untagging is done by respective department like mech , elec. after approval of operation department. i used two user status in user status profile INIT & work completed. init in initial status when wcd is created. when initail is active untemporarily tagging , utang, temporarily untag & untagged business transaction can not be performed. change of user status is only given to operation department. when operation department change the user status to work completed of wcd item after that respective department able to do  untemporarily tagging , utang, temporarily untag & untagged business transaction. but when i create check at wcd item leve it dosnt work.
    object type assigned in oibs is wcd item only
    in starting when make ths check by user status at wcd item level , it is working fine but after deletion i reassigned the same it it not working.
    then i try to assign it at wcd header it also not working.
    kindly help. if u want to take my sytem on remote i can do the same

  • How to check a text type if it is filled or not for specific user status

    Hello;
    I want to check if a text type in a notification is filled or not for a specific user status. I guess that can be done using the BADI "ORDER_SAVE", but not sure how to do that.
    Regards,
    Erkan Kaya

    Hello Erkan.
    You can use the function module CRM_ORDER_READ_OW in method check_before_save of BADI ORDER_SAVE.
    Fill the header_guid of the notification into the it_header_guid table parameter and get the returning table ET_TEXT.
    For performance reason you should provide importing parameter it_requested_objects.
    INCLUDE CRM_DIRECT.
    APPEND gc_object_name-texts TO it_required_objects.
    Then you can check in et_Text if the required text is maintained. If not, you can raise the exception DO_NOT_SAVE in the BADI.
    Regards,
    Timo.

  • Update order user status based on a custom check box value in web ui

    Hi Experts,
    I have a requirement to Update the  user status based on a custom check box value in web ui.
    This is needed at the followup for a SR, the component is BT116H_SRVO, Details View.
    I created a value node with 4 checkboxes, based on the check box value, the corresponding user status
    need to be updated.
    How can I reach to the order save functionality of SAP in EH_ONSAVE method, so that syatem can capture my check box value, along with other screen fields, and append the status parameter in Order maintain?
    or do I have to call order maintain in even handler for checkbox, which will affect performance .....
    Pls help.
    Regards,
    Lakshmi

    Hi,
    In your event handler you can use bol entity corresponding to status BTStatusH and change the user status.
    Best regards,
    Caíque Escaler

  • Authority Check at the T.Code level for the user in particular User Group

    Hi Friends,
    I have created a ZREPORT and assigned this report to a ZTRANSACTION CODE.
    Need to give Authority Check at the T.Code level for the user in particular User Group.
    I have searched in SCN, but not get suitable pages.
    How to solve this?
    Regards,
    Viji.

    Hi Viji.
    Saha way is actual way for authority tcode but user authority in TCODE:- SE38 he/she can run report(ZREPORT) wise program is run is no authority check.
    Another way is you have also check authority in program level.
    DATA: T_ROLE_USERS TYPE STR_AGRS OCCURS 0 WITH HEADER LINE.
       INITIALIZATION.
      CALL FUNCTION 'ESS_USERS_OF_ROLE_GET'
        EXPORTING
          ROLE       = 'ZROLE''  " Role define
        TABLES
          ROLE_USERS = T_ROLE_USERS.
      READ TABLE T_ROLE_USERS WITH KEY UNAME = SY-UNAME.
       IF SY-SUBRC NE 0.
       RETURN.
       ENDIF.
    Thanks & Regards
    Rahul

  • Checking authorization of user status

    Hej there!
    In our CRM-system I would like to check whether a user has authorization to set a particular user status in a servicecontract.
    I know it is possible to check whether a user is authorised for a status scheme via object S_USERSTAT, but I can't find an authorization object which checks on a particular value within the status scheme.
    Is it possible to make such a check via an authorization object or BADI or ....???
    Regards,
    Henry Helderop

    Hi Henry,
    I have no access to a CRM system.
    In other systems like R/3 or APO user status are handled with object B_USERSTAT or B_USERST_T.
    There you can check on values for
    o activity
    o authorization key
    o object type
    o status profile
    maybe this is the way to restrict the access to service contracts.
    Regards
    Ferdi

Maybe you are looking for

  • Inventory Ageing report required

    Hi SAP Experts I want to create an inventory ageing report which is based on FIFO valuation method and will be at company level. It should display time intervals like 0-30, 30-60, 60-90 etc but these intervals can be dynamic means we can change these

  • Best DSfW Design for new small Tree

    I looking to build a replacement tree and server infrastructure for a small network, 80-90 users at a single location, with the possibility of adding 1 or 2 additional locations in the future. I want/need to make it as Active Directory friendly as po

  • Dynamic change of values

    Hi All, I am new to this Oracle Apex. We are using Oracle Application Express Release 4.0 I have a query. Here When validate item trigger wont fire.So how to over come this problem Ex: Say i have 4 text fields, i button Based on the value in first fi

  • Can't position windows on second screen JDeveloper 10.1.3 EA1

    I love to work with JDeveloper. For a better overview i use two monitors. At monitor one I place the JDeveloper Main Windows with the code-editor. On the second monitor I place the other windows like "Structure" or Log-Windows. This works good with J

  • Can you restore an iTunes Library from an iPod Touch??

    I had a hard drive crash on my PC and lost my iTunes Library. Can I recreate it from my iPod Touch? My fear is that I'll connect my iPod and everything will be erased. I have not yet downloaded new iTunes s/w. Jim