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

Similar Messages

  • 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

  • How to check whether the particular schema(user) is having import privilege

    Hi,i need to check whether a particular schema(user) is having privilege to import the data to target database within the same database(10 g)

    Answer is in the documentation - which is pretty easy to look up -
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm#i1007024
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_5406.htm#REFRN26230
    HTH
    Srini

  • Code to check whether a given string contains alphanumeric

    Can anyone post the Code to check whether a given string contains only alphanumeric and no special characters

    <Rule name='isAlphaNumericString'>
    <RuleArgument name='testStr'/>
    <block>
    <defvar name='counter'>
    <i>0</i>
    </defvar>
    <defvar name='splitString'>
    <while>
    <lt>
    <ref>counter</ref>
    <length>
    <ref>testStr</ref>
    </length>
    </lt>
    <append name='splitList'>
    <substr>
    <ref>testStr</ref>
    <ref>counter</ref>
    <i>1</i>
    </substr>
    </append>
    <set name='counter'>
    <add>
    <ref>counter</ref>
    <i>1</i>
    </add>
    </set>
    </while>
    <ref>splitList</ref>
    </defvar>
    <containsAll>
    <list>
    <s>A</s>
    <s>B</s>
    <s>C</s>
    <s>D</s>
    <s>E</s>
    <s>F</s>
    <s>G</s>
    <s>H</s>
    <s>I</s>
    <s>J</s>
    <s>K</s>
    <s>L</s>
    <s>M</s>
    <s>N</s>
    <s>O</s>
    <s>P</s>
    <s>Q</s>
    <s>R</s>
    <s>S</s>
    <s>T</s>
    <s>U</s>
    <s>V</s>
    <s>W</s>
    <s>X</s>
    <s>Y</s>
    <s>Z</s>
    <s>a</s>
    <s>b</s>
    <s>c</s>
    <s>d</s>
    <s>e</s>
    <s>f</s>
    <s>g</s>
    <s>h</s>
    <s>i</s>
    <s>j</s>
    <s>k</s>
    <s>l</s>
    <s>m</s>
    <s>n</s>
    <s>o</s>
    <s>p</s>
    <s>q</s>
    <s>r</s>
    <s>s</s>
    <s>t</s>
    <s>u</s>
    <s>v</s>
    <s>w</s>
    <s>x</s>
    <s>y</s>
    <s>z</s>
    <s>0</s>
    <s>1</s>
    <s>2</s>
    <s>3</s>
    <s>4</s>
    <s>5</s>
    <s>6</s>
    <s>7</s>
    <s>8</s>
    <s>9</s>
    </list>
    <ref>splitString</ref>
    </containsAll>
    </block>
    </Rule>
    It Retruns 1 if it contains only alphanumeric otherwise 0

  • 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)

  • 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. :(

  • How to check whether a node exist in a Particular Level. (xmltype)

    hi,
    please help me to check whether a particular node exists in one level.
    for eg
    I have the following xml
    <map>
         <entry>
              <key>
                   heading1
                   </key>
              <map>
                   <entry>
                        <key> sub1 heading1</key>
                        <value> sub1 heading1 value  </value>
                   </entry>
                   <entry>
                        <key> sub2 heading1 </key>
                        <value> sub2 heading1 value  </value>
                   </entry>
              </map>
         </entry>
         <entry>
              <key>
                   heading2
                   </key>
              <map>
                   <entry>
                        <key> sub1 heading2</key>
                        <value> sub1 heading2 value  </value>
                   </entry>
                   <entry>
                        <key> sub2 heading2 </key>
                        <value> sub2 heading2 value  </value>
                   </entry>
              </map>
         </entry>
    </map>i need to check how many heading exists in this xml.
    I am checking like
            i:=1;
         l_section := ip_xml.extract('//map/entry');
         WHILE l_section.existsnode('entry[' || i|| ']') = 1 LOOP
              // extract the key name within entry tag
                  // print the key name.
    i:=i+1;
         end loop;but iam getting all the key name like
    heading1
    sub1 heading1
    sub2 heading1
    heading2
    sub1 heading2
    sub2 heading2
    I need only heading1 and heading2. how can I check whether a particular node exist in particular level.
    first level , second level etc. Please help

    but iam getting all the key nameThat's because you're using a descendant axis : //map/entry
    SQL> DECLARE
      2 
      3   ip_xml  xmltype := xmltype('<map>
      4       <entry>
      5            <key>
      6                 heading1
      7                 </key>
      8            <map>
      9                 <entry>
    10                      <key> sub1 heading1</key>
    11                      <value> sub1 heading1 value  </value>
    12                 </entry>
    13                 <entry>
    14                      <key> sub2 heading1 </key>
    15                      <value> sub2 heading1 value  </value>
    16                 </entry>
    17            </map>
    18       </entry>
    19       <entry>
    20            <key>
    21                 heading2
    22                 </key>
    23            <map>
    24                 <entry>
    25                      <key> sub1 heading2</key>
    26                      <value> sub1 heading2 value  </value>
    27                 </entry>
    28                 <entry>
    29                      <key> sub2 heading2 </key>
    30                      <value> sub2 heading2 value  </value>
    31                 </entry>
    32            </map>
    33       </entry>
    34  </map>');
    35 
    36  BEGIN
    37 
    38    for r in (
    39      select heading, headno
    40      from xmltable( '/map/entry/key'
    41                     passing ip_xml
    42                     columns heading varchar2(30) path '.'
    43                           , headno  for ordinality )
    44    )
    45    loop
    46      dbms_output.put_line('Heading '||r.headno||' = '||r.heading);
    47    end loop
    48    ;
    49 
    50  END;
    51  /
    Heading 1 =
                   heading1
    Heading 2 =
                   heading2
    PL/SQL procedure successfully completed

  • How to check whether a vriable is declared or not?

    Hi,
    Problem:
    A glogal variable named :GLOBAL.ENV is used in one of my form.
    But its value is coming from another form which is developed by another programmer.
    I need to check like this:
    IF :GLOBAL.ENV='SOMETHING' THEN
    END IF;
    But, if the other developer doesn't assign a value for the global variable, i am getting an error like this:
    FRM-40815: Variable GLOBAL.ENV does not exists
    So, i need to know whether the GLOBAL.ENV already exists before using it in my form.
    That is, i need to do like this:
    IF (code to check whether GLOBAL.ENV exists ) then
    use GLOBAL.ENV
    ELSE
    Assign a default value to GLOBAL.ENV
    END IF;
    Thanks for your time...

    Thank you very much...
    I used DEFAULT_VALUE('def val','GLOBAL.ENV');
    Now the problem is solved.

  • Check whether logged in user has admin previleges

    Hi,
    Can anyone share c# code that checks whether the logged in user is Farm administrator.
    Thanks in advance

    Hi 
    You can check using below code 
    public static bool IsFarmAdmin(string loginName)
                bool isFarmAdmin = false;
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    SPGroup adminGroup = SPAdministrationWebApplication.Local.Sites[0].AllWebs[0].SiteGroups[“Farm Administrators”];
                    foreach (SPUser user in adminGroup.Users)
                        if (user.LoginName == loginName)
                            isFarmAdmin = true;
                            break;
                return isFarmAdmin;
    below is reference for the same
    https://social.msdn.microsoft.com/Forums/office/en-US/1fa3287a-c732-4924-b75d-fec493446389/checking-if-a-given-user-is-farm-administrator?forum=sharepointdevelopmentlegacy
    or this
    Some possibly easier ways would be the following:
    bool isSiteAdmin = SPContext.Current.Web.UserIsSiteAdmin;
    isSiteAdmin = SPContext.Current.Site.UserIsSiteAdminInSystem;
    bool isFarmAdmin = SPFarm.Local.CurrentUserIsAdministrator();
    https://social.msdn.microsoft.com/Forums/office/en-US/9ecf128b-a2b9-4669-b86c-aaaba19ff97d/how-to-determine-if-a-user-is-site-collection-or-farm-admin-in-the-webpart-c-code?forum=sharepointdevelopment
    Regards, Rajendra Singh If a post answers your question, please click Mark As Answer on that ost and Vote as Helpful http://sharepointundefind.wordpress.com/

  • Checking the session if valid goes to particular resource or request bypass

    checking the session and whether user has logged in if logged in goes to particular resource or request bypasses to particular redirected resource in filters can u suggest me the code too ...thanku

    Hi,
    you can check wether or not a user is authenticated by accessing the request object and calling getUserPrincipal() or getUsername(). If a user is not authenticated then this reqests return NULL
    Frank

  • How to check Whether the File is in Progress or used by some other resource

    Hi All,
    I am retrieving a file from the FTP server using Apache commons FTP.
    I need to check whether the file is fully retrieved or in progress.
    for now i can able to use the file which is partially retrieved. it is not throwing any file sharing exception or i am unable to find whether it is in progress.
    How to check whether the file is in progress ? or The file is accessed by some other resource ?
    Pls Help me.
    Thanks,
    J.Kathir

    Hi Vamsi,
    Explicitly such kind of requirement has not been catered and i dont think you would face a problem because any application that is writing to a file will open the file in the read only mode to any other simultaneous applications so i think your concerns although valid are already taken care off .
    In the remote case you still face a problem then as a work around. Tell the FTP administrator to set the property to maximum connections that can be made to ftp as one. I wonder if you have heard of the concept of FTP handle , basically the above workaround is based on that concept itself. This way only one application will be able to write.
    The file adapter will wait for its turn and then write the files.
    Regards
    joel
    Edited by: joel trinidade on Jun 26, 2009 11:06 AM

  • How to poll directory to check whether new file is added in plsql code

    How to poll directory to check whether new file is added in plsql code

    You can simply try opening that file for read in a loop (with some sleep in between). But in some OS (e.g. UNIX) file is accessible even if it is partially written. I suggest creating OK file (empty file with same name and OK as extension) after creating main file. This way PL/SQL code will be polling for OK file which means main file is completed.
    SY.

  • How to check whether music has finished playing and go to another frame

    I have a bunch of music samples which are set up to play on
    the click of a button, and at the same time go to another frame in
    the movie clip so it says 'playing', with a stop button that takes
    you back to frame 1. If you don't click stop, though, when the song
    ends, it stays on this second frame, even though there is nothing
    playing anymore, which is a bit confusing for the viewer.
    So I need to tell flash to check whether the song is finished
    playing, and then if it is, go back to frame 1. I have no idea how
    to do this; have basically done it all using tutorial and samples
    and my limited actionscript knowledge, but I can't find this
    particular code, and don't really have any idea how to write it
    from scratch.
    Many thanks!
    Here's my first frame actionscript:
    stop();
    this.createEmptyMovieClip ("mcSoundHolder",
    this.getNextHighestDepth());
    var mySound:Sound = new Sound (mcSoundHolder);
    btn_Song1.onRelease = function():Void {
    stopAllSounds();
    mySound.loadSound("Soaring1-Burlesque.mp3", true);
    gotoAndPlay("Song1");
    btn_Song2.onRelease = function():Void {
    stopAllSounds();
    mySound.loadSound("Soaring2-PopCyclePotpourri.mp3", true);
    gotoAndPlay("Song2");
    btn_Song3.onRelease = function():Void {
    stopAllSounds();
    mySound.loadSound("Soaring3-PopCycle-SongofLight.mp3",
    true);
    gotoAndPlay("Song3");
    and so on...

    I am not sure how Tomcat handles this, but you need to use two-way (mutual authentication) request but not enforce SSL between Tomcat and the client browser. This will make the browser prompt the user for the cert they want to send. Then you'll need to tackle the other part of your problem, getting the correct content displayed depending on whether the user sent a cert or not. I'm even less help there than I was on the first part of your question.
    So, yeah - good luck with that
    Lee

  • How to check whether ESBAgentListener listener is started or not for ESBSys

    Hi,
    I am working on Oracle ESB 10g, I want to know how to check whether the ESBAgentListener listener is started or not for particular ESB system. I know we can verify the logs but I want to know is it possible from database or any other sources.
    Thanks in advance.
    Ramesh

    Hi Jogdand ,
    You can get the PO total value change form the PO business Object BUS2201 attribute  POTotalValueIncreased .
    Below code sample decribes how to get the BO attribute values
    1. INCLUDE <swfcntn01>.
    2. Create an instance of the BO by calling the macro and passing the three parameter.
        swf_create_object     <po bor object>     <BUS2201>     <po_guid>
    3. Get the PO attribute by calling macro
      swf_get_property   <po BOR object>   < 'POTotalValueIncreased' >    < lv_pototalvalueincreased>
    OR
    You can query the table BBP_PDHGP and get the original Value of the PO and call the FM BBP_PD_PO_GETDETAIL to get the new Value of the PO. Check the difference and if there is any difference then the PO value is changed.
    I hope this will be very useful.
    Regards,
    Surender

  • Error while running a sample code

    Hello,
    I 'm getting the following error while i'm trying to run a
    sample code which I have imported into Flex 3.
    ===================================================================
    Severity and Description Path Resource Location Creation Time
    Id
    unable to open 'C:\Documents and Settings\sn55179\My
    Documents\Flex Builder
    3\FlexForDummies_Chapter3_Code\libs'FlexForDummies_Chapter3_Code
    Unknown 1237909480511 215
    ===================================================================
    Can anyone help me in resolving this issue.
    Many thanks in advance.

    It's very frustrating that FB stops working when the libs
    folder is missing. If you are checking in project files to a source
    control app like Perforce, empty folders don't get added, so if you
    don't add an initial dummy file, the next time you do a clean sync,
    the libs folder may not be there, and even though there is nothing
    there, FB complains. :-(

Maybe you are looking for

  • How do I find out what filter effect I used on an image after I have saved it?

    I used a series of filters that gave an image a very cool painterly - impressionistic painting - quality.  I have forgot what steps I took to get that effect.  I have tried to go back and look at the image history but that did not tell me anything si

  • Applying effect turns clip black

    I've got 26 students working on their first projects, and this has popped up twice now. Start with a clip on the timeline. Select it. Go to video effects. Choose an effect. Watch the preview. Click "apply." Wait for the render to complete. POOF! What

  • File-Xi-File scenario donu00B4t work.

    Hi!! We have a poblem with a FILE-XI-FILE scenario via NFS. We have a Flat File in a Xi directory (AL11) . The first process work correctly. The file is deleted from this directory and mapped to a XML file into Xi. SXMB_MONI shows the message is corr

  • TS1347 (How) can I transfer docx/exlx file to my iPad?

    (How) can I transfer docx and exlx files to my iPad mini?

  • LIS service and the subnets...

    Hi, I have a network: 10.0.242.0 with mask: 255.255.254.0. That means that available addresses on the subnet have from 10.0.242.1 to 10.0.243.255. But when I try to add that subnet into LIS I could not get it work. When I took the trace on the server