Unassign user from a OIM Group using API/Java Code

Hello OIMers,
Can you please tell me how should I Un-assign a group membership through code?
This is the case:
When the user is deleted from Active Directory, I want to Unassign the User from a group, assume the name of the group is "FullTime Employees".
Currently How I do this is Click on the User Profile in Admin Console then select Group Membership from drop down and then select unassign for that group.
Please tell me how should I do the above task programmatically, This would solve my problem.
Thanks everyone in advance.
Regards,
VSN

Hi all,
I am using the following api:
uintgroupf = (tcGroupOperationsIntf)tcUtilityFactory.getUtility(db, "Thor.API.Operations.tcGroupOperationsIntf");
uintgroupf.removeMemberUser(arg0, arg1);
arg0 - is group key............Can you tell me how should I fetch this Group Key??
Thanks.
Regards,
VSN

Similar Messages

  • Script to logout users from a specific group, when queries are long

    Hi,
    I have a requirement that users from a specific group need to be logged out, when they are running queries for more than say 20 mins.
    I could get the list of users from that group and could get the list of active sessions on the application, but I get too many info there like connection IP request state etc. and if I spool it to a file, output is not very easy to format to select what's required, rather I have to write lot of shell scripting to format the file.
    So my question here is to know if there's a MAXL script or any other method through which I can just get only couple of columns from the "display session on application <app name>" that I require for my work like username, session ID, DB connect time, and request time.
    Thanks!!

    There are a number of ways to accomplish this, but AFAIK none of them is straightforward like writing a script to accomplish the task.
    This could be accomplished quite readily with the Essbase API.
    Unfortunately, when Maxl outputs tabular data such as what comes out after DISPLAY SESSION ALL; - it comes out as all one big string with lots of spaces.
    So to parse that output you would need to use a language that can tokenize the text into a collection and parse that for the users.
    Then you need to do the same sort of thing after running DISPLAY USER IN GROUP ALL; (or instead of all, use a specific group name);
    Then run ALTER SYSTEM LOGOUT SESSION BY USER <parsed_username>;
    What would be ideal (hello Oracle... <wink> ) is a MAXL command ALTER SYSTEM LOGOUT SESSION BY GROUP <GroupName>;
    The way I would approach this would be to write a little utility that does exaclty what you seek:
    - Scan the current session periodically (say, once every 5 mins)
    - for each user that belongs to group(s) <group>(<group>...)
    - if user has an open query running longer than n minutes, kill the user request.
    This way you're not kicking people, your just taking back resources. Of course you can be more aggressive and code it to kick the user by forcefully ending (invalidating) his session too.
    I can give you a hand with this offline if you want.
    Robb

  • How to add users from person or group field in a sharepoint list to sharepoint group

    Hi,
    How to add users(single or multiple) from person or group field in a sharepoint list to sharepoint group programmatically?
    Any suggestions would be appreciated.
    Thank you,
    AA.

    Hello,
    Use SPGroup.AddUser() method to add user in group. I have just written sample code in notepad so it is not tested:
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using(SPSite Site = new SPSite(SPContext.Current.Site.Url))
    Using(SPWeb Web = Site.OpenWeb())
    SPList list = web.Lists["ListName"];
    SPQuery query=new SPQuery ();
    query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test</Value></Eq></Where>";
    SPListItemCollection items = list.GetItems(query);
    if(items.Count > 0)
    foreach(SPListItem item in items)
    //Get USers from person or group column
    SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
    SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString());
    SPGroup spGroup = spSite.RootWeb.Groups[groupName];//group name
    if (users.Count != 0)
    bool isUserInGroup = false;
    foreach (SPFieldUserValue user in users)
    foreach (SPUser item in spGroup.Users)
    string itemUserName = item.LoginName;
    string UserName = user.User.LoginName;
    if (itemUserName == UserName)
    isUserInGroup = true;
    break;
    if (!isUserInGroup)
    spGroup.AddUser(user.User);
    The above code will query list item and then get users from "Users" column. Now it will check whetehr user is already in group not, if not then add user in group.
    http://rajanijilla.blogspot.sg/2012/09/add-users-to-group-programmatically.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Adding and removing current user from one SharePoint group to another with event receiver

    hi friends
    i need to change current user from one SharePoint group to another with list item adding event receiver.
    please help me

    Hi Malli,
    Greetings. Its nt possible
    http://sharepoint.stackexchange.com/questions/42286/event-receivers-on-add-remove-users
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Remove users from all distribution groups in Microsoft 365

    Hello
    I would like to know if there is a way I can remove a user from all distribution groups in Microsoft 365. I have a rather large list of users that this would need to be applied to though.
    Any help would be greatly appreciated.
    John

    I would assume yes since there is a cmdlet called, "Remove-DistributionGroupMember", you usually have to have to post some code of what you have
    tried or working on to get further help from most other people here. 

  • How to remove user from custom DLU Group

    Hi,
    I have created a DLU policy that creates a local user, and places this user
    in a custom local group (Group is already present on the system). Now I want
    to remove this user from this custom group and place it in another custom
    group. I have created a second DLU policy to place the user in the new
    custom group. The new custom group is added fine, but the old custom group
    assignment also remains. How should I set up the policy so that the user is
    removed from the old custom group, or is this not possible?
    Regards,
    Hen

    Hen,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Detect user to see if still using the transaction code

    Hi,
    Is there a way to detect if the user is still working in a transaction code that the Exit FM is linked to? I have a requirement to detect the user's action within the transaction code enviroment and then according to whatever the user is doing, the Exit FM should process certain tasks.  Instead of checking for the OK_CODE for the screen status, can I check the transaction code level to see if the user is  still working with it?
    Thanks,
    RT

    Hi Rich,
    Actually I am trying to detect whether a user is still working in the transaction code or not. I have tried to code the PF-STATUS and SY-UCOMM to detect the user's allowable actions within this transaction code, but I was told that the Exit FM cannot recognize the PF-STATUS and its OK_CODE, so I am now trying to take a different approach by detecting whether the user has either exited the transaction code or the BW system.
    I am trying to refresh a transparent table within the Exit FM based on whether the user is doing something when using this transaction code. The Exit FM is doing the refresh.
    Would you think this is possible? Please advise.
    Thanks,
    RT
    Message was edited by: Rob  Thomas

  • Pass the data back from the jsp page to the java code

    Hi,
    I have written an iView that receives an event using EPCF and extracts data from the client data bag.
    I need this iView to pass the data back from the jsp page to the java code.
    I am trying to do this using a hidden input field, but I cannot get the code to work.
    Here is the code on the jsp page.
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId">
    <hbj:inputField id="myInputField" type="string" maxlength="100" value="" jsObjectNeeded="true">
    <% myInputField.setVisible(false);%>
    </hbj:inputField>      
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <script language=JavaScript>
    EPCM.subscribeEvent("urn:com.peter", "namedata", window, "eventReceiver");
    function eventReceiver(eventObj) {
         var url = eventObj.dataObject;
         var funcName = htmlb_formid+"_getHtmlbElementId";
         func = window[funcName];
         var ipField = eval(func("myInputField"));
         ipField.setValue(url);
         var form = document.all(htmlb_formid);
         form.submit();
    </script> 
    Here is my java code
    package com.sap.training.portal;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    public class ListSalesOrder extends PageProcessorComponent {
      public DynPage getPage(){
        return new ListSalesOrderDynPage();
      public static class ListSalesOrderDynPage extends JSPDynPage{
         private String merong;
        public void doInitialization(){
        public void doProcessAfterInput() throws PageException {
              InputField reportfld = (InputField) getComponentByName("myInputField");
              if (reportfld != null)      merong = reportfld.getValueAsDataType().toString();
        public void doProcessBeforeOutput() throws PageException {
              if ( merong != null ) setJspName("merong.jsp");
              else setJspName("ListSalesOrder.jsp");
    Here is DD
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="SearchSalesOrder">
          <component-config>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="/pagelet/SearchSalesOrder.jsp"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
        <component name="ListSalesOrder">
          <component-config>
            <property name="ClassName" value="com.sap.training.portal.ListSalesOrder"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    After receive event, then call java script function "eventReceiver" and call "form.submit()".
    But .. PAI Logic in Java code doesn't called ...
    Where is my problme ?
    Help me ...
    Regards, Arnold.

    Hi Arnold,
    you should not do a form.submit yourself. Instead you can put a component called ExternalSubmit to your page:
    ExternalSubmit exSubmit = new ExternalSubmit("EX_SUBMIT"));
    exSubmit.setServerEventName("MyEvent");
    This results in a java script funtion on the page which is called "_htmlb_external_submit_". If you call this function the the form gets submitted and your event handler is called.
    regards,
    Martin

  • How to call web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • Access ABAP tables using NWDS Java Code

    All,
    I am planning to write a program to autmatically update is_url entries in sxmb_admin using a Java program.
    Is there a way we can access the ABAP tables using standalone Java Code? would it something like dblookup that we use in the mappings?
    Your Thoughts....
    Thanks.

    Hi Vicky - Interesting..Seems like you are trying to automate every single thing
    However you can make use of Jco to connect to ABAP tables..
    Check the below thread..
    Help on accessing tables of SAP from the Java Application
    I assume the table name is "SXMSCONFVLV" which you might have to update but not sure..

  • JavaScript is not from the same origin as the Java code

    When trying to log into my school website with Safari, I get the following error from the console:
    sun.plugin.liveconnect.OriginNotAllowedException: JavaScript is not from the same origin as the Java code, caller=http://tychousa3.umuc.edu/WebTycho.nsf/setJVMCookie?OpenPage, callee=https://tychousa3.umuc.edu/sys/
    This keeps me from logging in. In order to get it to work, I have to disable Java, log in, then reenable Java after logging in.
    I am able to log in successfully with Firefox but I really prefer to use Safari.
    Does anyone else experience this problem and do you know how to fix it? Any help would be very much appreciated. Thanks.
    iBook 933 - PPC   Mac OS X (10.4.5)  

    I'm reposting. No answer.

  • Use of Java Code within the generated XML Forms Stylesheets

    Hello,
    is the use of Java-Code possible with the XSL-Files generated by XML-Forms, as possible in standard XSLs? I know that this would mean a modification.
    kind regards,
    Marco

    Hi Marco,
    I "executed" some java code within XSLs file. I have quoted the word executed because I didn't really run java code, but I used a simply trick that I describe you below.
    Into your XSLs put an iframe which is hided (it has an height of 0 pixel). As src of the iframe put the address of a portal component which execute your code (in my case calculate some PCD URL of some pages into a defined role). As result of component execution, I use the response.write method in order to execute some jscript code, which is able to interact with the HTML generated by XSLs files, for example in my case response.write put the PCD URL into a drop down list placed into the "edit" form.
    This works fine. I don't know if is suitable also for your case, anyway could be a hint, but pay attention to Roland's recommendations.
    Ciao
    Roberto

  • Creation of a Request in OIM 11G using API's

    Hi Friends,
    I am trying to create a request using OIM 11g API's.
    I am trying to do this for EBS Responsibility resource and this resource has a request dataset has EBS-IT-Resource-Instance, application name, responsibility name, start date and security group. Please note application name, responsibility name, start date and security group are in child form.
    I am trying to populate the request dataset using the below code.
    List<RequestBeneficiaryEntityAttribute> entityAttrList;
    RequestBeneficiaryEntity entity = null;
    entityAttrList = new ArrayList<RequestBeneficiaryEntityAttribute>();
    entity = new RequestBeneficiaryEntity();
    tcITResourceInstanceOperationsIntf tcITResourceIntf = Platform.getService(tcITResourceInstanceOperationsIntf.class);
    HashMap searchcriteria = new HashMap<String, String>();
    searchcriteria.put("IT Resources.Name", "EBSHF-APPS12");
    tcResultSet resultSet = tcITResourceIntf.findITResourceInstances(searchcriteria);
    long itResourceKey=resultSet.getLongValue("IT Resources.Key");
    entityAttrList.add(this.getAttrLong("eBusiness Suite Instance Name",itResourceKey));
    entityAttrList.add(this.getAttr("Application Name","3~300"));
    entityAttrList.add(this.getAttr("Responsibility Name", "3~300~52281"));
    entityAttrList.add(this.getAttr("Security Group", "3~0"));
    entity.setEntityKey(getResourceKey("Oracle eBusiness Responsibility"));
    entity.setEntityType(RequestConstants.RESOURCE);
    entity.setEntitySubType("Oracle eBusiness Responsibility");
    entity.setEntityData(entityAttrList);
    private RequestBeneficiaryEntityAttribute getAttr(String name, String value)
    RequestBeneficiaryEntityAttribute attr = null;
    attr = new RequestBeneficiaryEntityAttribute(name, value, RequestBeneficiaryEntityAttribute.TYPE.String);
    return attr;
    private RequestBeneficiaryEntityAttribute getAttrLong(String name, long value)
    RequestBeneficiaryEntityAttribute attr = null;
    attr = new RequestBeneficiaryEntityAttribute(name, value, RequestBeneficiaryEntityAttribute.TYPE.Long);
    return attr;
    My code is working fine and a request is getting created. But when I try to open the request dataset(object form) for the newly created request, I am getting null exceptions.
    If I did not populate the fields that are in the child form application name, responsibility name and security group which are highlighted above, then I am able to view the form with the correct IT-Resource-Instance name after request creation.
    So, I am thinking I am doing something wrong while populating child form data in the request dataset.
    Can you please provide me some code snippet to populate the child using 11G API'S?

    Hi Bikash,
    After referring your code, i made changes in mine. Here is my updated code.
    RequestBeneficiaryEntityAttribute parantAttr=null;
    List<RequestBeneficiaryEntityAttribute> entityAttrList;
    RequestBeneficiaryEntity entity = null;
    entity = new RequestBeneficiaryEntity();
    parantAttr=this.getAttrLong("eBusiness Suite Instance Name", itResourceKey);
    RequestBeneficiaryEntityAttribute mid1 = new RequestBeneficiaryEntityAttribute();
    List <RequestBeneficiaryEntityAttribute> childAttributesList = new ArrayList<RequestBeneficiaryEntityAttribute>();
    childAttributesList.add(this.getAttr("Application Name", "3~555"));
    childAttributesList.add(this.getAttr("Responsibility Name", "3~555~22862"));
    childAttributesList.add(this.getAttr("Security Group", "3~0"));
    mid1.setChildAttributes(childAttributesList);
    mid1.setAction(RequestBeneficiaryEntityAttribute.ACTION.Add);
    entityAttrList = new ArrayList<RequestBeneficiaryEntityAttribute>();
    entityAttrList.add(parantAttr);
    entityAttrList.add(mid1);
    But when I try to run this, it is getting failed saying "RequestServiceException: IAM-2050033:Invalid attribute name null. No corresponding reference was found in the data set ProvisionResourceOracle eBusiness Responsibility".
    Here is my request data set for your reference.
    <AttributeReference name="eBusiness Suite Instance Name" attr-ref="eBusiness Suite Instance Name" type="Long" length="50" widget="itresource-lookup" required="true" available-in-bulk="true" itresource-type="eBusiness Suite UM"/>
    <AttributeReference available-in-bulk="true" length="10" widget="text" type="String" attr-ref="UD_EBH_RSCP" name="EBS HR Foundation User Responsibilities">
    <AttributeReference name="Application Name" attr-ref="Application Name" type="String" length="256" widget="lookup-query" available-in-bulk="true" required="true">
    <lookupQuery lookup-query="select lkv_encoded as Value,lkv_decoded as Description from lkv lkv, lku lku where lkv.lku_key=lku.lku_key and lku_type_string_key='Lookup.EBS.Application' and lkv_encoded like concat('$Form data.eBusiness Suite Instance Name', '~%')" display-field="Description" save-field="Value"/>
    </AttributeReference>
    <AttributeReference name="Responsibility Name" attr-ref="Responsibility Name" type="String" length="256" widget="lookup-query" available-in-bulk="true" required="true" primary="true">
    <lookupQuery lookup-query="select lkv_encoded as Value,lkv_decoded as Description from lkv lkv,lku lku where lkv.lku_key=lku.lku_key and lku_type_string_key='Lookup.EBS.Responsibility' and lkv_encoded like concat('$Form data.Application Name','~%')" display-field="Description" save-field="Value"/>
    </AttributeReference>
    <AttributeReference name="Security Group" attr-ref="Security Group" type="String" length="256" widget="lookup-query" available-in-bulk="true" required="true">
    <lookupQuery lookup-query="select lkv_encoded as Value,lkv_decoded as Description from lkv lkv, lku lku where lkv.lku_key=lku.lku_key and lku_type_string_key='Lookup.EBS.SecurityGroup' and lkv_encoded like concat('$Form data.eBusiness Suite Instance Name', '~%')" display-field="Description" save-field="Value"/>
    </AttributeReference>
    I am not sure why it is not referencing to the attribute. In your blog, it is saying your code is to set process form. But i am trying to create a request using API's. so, I need some code snippet to populate request dataset. Do you think, this will serve both?
    Thanks for your help.

  • How to obtain Role name in OIM 11g using API's

    Hello,
    I have a scenario in which I create Role/Group in OIM 11g & it gets provisioned in AD [=works fine] & other part is when i delete role in OIM 11g then it should
    get deleted from AD.I have written postprocess event handler to achieve this.
    In role creation part i get all parameters using "orchestration.getParameters();" , but when i delete role then "orchestration.getParameters();" is empty,so i am
    not able to get role name.
    Is there a way to get role name while deleting roles using API ?
    Thanks,
    Rahul Shah

    Hi Raghav,
    Following is my code :
    tcRODetails = orgOpInterface.getObjects(organizationKey);
    for(int i = 0;i < tcRODetails.getRowCount();i++){
    tcRODetails.goToRow(i);
    // resourceName=AD Group
    if(resourceName.equalsIgnoreCase(tcRODetails.getStringValue("Objects.Name"))&&
    tcRODetails.getStringValue("Objects.Object Status.Status").equalsIgnoreCase("Provisioned")||
    tcRODetails.getStringValue("Objects.Object Status.Status").equalsIgnoreCase("Enabled")) {
    System.out.println("<<<FOUND>>>");
    processKey = tcRODetails.getLongValue("Process Instance.Key");
    provisionObjectKey = tcRODetails.getLongValue("Objects.Key");
    tcProcessSet = oimFormUtility.getProcessFormData(processKey);
    for(int j=0;j<tcProcessSet.getRowCount();j++){
    tcProcessSet.goToRow(j);
    if(grpName.equalsIgnoreCase(tcProcessSet.getStringValue("UD_ADGRP_NAME"))){
    System.out.println("MATCH FOUND!!!!!");
    orgOpInterface.removeObjectAllowed(organizationKey,provisionObjectKey);
    break;
    & i get following error :
    <Mar 22, 2012 1:54:43 PM IST> <Error> <XELLERATE.APIS> <BEA-000000> <Class/Method: tcOrganizationOperationsBean/removeObjectAllowed encounter some problems: Object with key=7 is not already set as an allowed object for Organization with key=1>
    Thanks
    Rahul Shah

  • Assign user external dir to group using MaxL

    Hi
    I have my essbase security sync with Shared services.
    Now i want to assign user to groups using Maxl
    Groups exist as Essbase native Groups
    Users exist as corporate directory and are NOT native users
    Now when i try to execute the following statement i get error saying 'user does not exist'
    Alter user 'username@corporatedir' add to group 'nativegroup';
    Is it not possible to assign users from external directory to native groups using Maxl?

    Not specifed your version.
    For 9.3.1 refer to page 103 for details. http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/hyp_security_guide.pdf
    The file looks like
    #group_children          
    id,user_id,user_provider
    myNativeGroup,User1,myProvider
    myNativeGroup,USer2,myProvider
    myNativeGroup,nativeUser3,Native Directory
    For better understanding, add one external user to a native group manually in shared services and then export using the utility.
    Then the exported file format can be used for your import.
    Hope it helps.

Maybe you are looking for