Is it possible to delete user in onUserSync callback method?

Hi,
  I've setup LADP and accessing the CQ using LADP authentication. I've been logging user info in 'onUserSync' callback method. But as per our requirement I don't want to create CQ user at some conditions. So I'm trying to remove user in 'onUserSync' callback method. But I'm getting exception while removing user at following statement.
userManager.getAuthorizable(userId).remove();
Here is my sample code:
public void onUserSync(User user,
Map<String, Value[]> attributes,
ValueFactory vf)
throws RepositoryException{
log.debug("####### Begin: onUserSync #######");
        Bundle b = FrameworkUtil.getBundle(getClass());
        BundleContext bc  = b.getBundleContext();
        ServiceReference sr  = bc.getServiceReference(Repository.class.getName());
        try{
            Repository repository = (Repository) bc.getService(sr);
            Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()), "crx.default");
            log.debug("============= Session created ===========");
           final JackrabbitSession jackrabbitSession = (JackrabbitSession) session;
           log.debug("============= jackrabbit Session created ===========");
           UserManager userManager = jackrabbitSession.getUserManager();
                      log.debug("User Name:{}",user.getID());
                String userId=user.getID();
                log.debug("Ldap Sync User Name:{}",userId);
                jackrabbitSession.save();
               log.debug("Jackrabbit session is saved before removing the gruop..");
              userManager.getAuthorizable(userId).remove();
             log.debug("User has been removed..");
                      jackrabbitSession.save();
           og.debug("Jackrabbit session is saved after removing the gruop..");
            jackrabbitSession.logout();
        }catch(Exception e)
            e.printStackTrace();
            log.debug("Exception:{}",e.getMessage());
              finally {
            if(sr != null){
                bc.ungetService(sr);
log.debug("####### End: onUserSync   #######");
Quick Responses would be more helpful..
Thanks
Siva

HI,
If in the process of setting up your Apple ID as the iMessages "Account" there have been some "extras" created you will have to do the following:-
Make the Finder the front App (listed in the menu bar)
Use the Go Menu
Hold down the ALT key and select the Library at appears.
Open Preferences
Find the file com.apple.imservice.iMessages.plist
Drag it to the Trash
Restart Messages
You may have to reset the iMessages/Apple ID up again but the "extras" should be gone.
10:20 PM      Monday; September 3, 2012
Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
  iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb (Snow Leopard 10.6.8)
 Mac OS X (10.6.8),
"Limit the Logs to the Bits above Binary Images."  No, Seriously

Similar Messages

  • Simple OAM questions (I think):  Possible to delete users and groups?

    Hi,
    I was wondering if, using the OAM admin, is it possible to delete a user?
    Same question regarding a group?
    For users, it seems like I can deactivate a user, but can't delete using the OAM admin?
    Thanks,
    Jim

    Deleting User:
    1. Create a "Deactivate User" work flow to deactivate the user account.
    2. Locate the deactivated user account from "Deactivated User Identity" link in User Manager.
    3. Select the user account you want to delete, click the Delete button to delete.
    Deleting Group:
    1. Create a "Delete Group" workflow in the workflow definition. Step1: Initial - Specifiy who can initialize the process; Step 2: Commit - commit the action.
    2. In the group information panel, click the Delete button to delete the group.

  • Is it possible to delete user accounts in Messages?

    When I went into Messages to set up an account, it somehow listed more than one account. Now I cannot seem to delete the second account that was created, and I think when I log into one, they both log in. It appears to be sending messages twice. I am not able to select the "-" button to delete the extraneous account. Any help would be greatly appreciated.

    HI,
    If in the process of setting up your Apple ID as the iMessages "Account" there have been some "extras" created you will have to do the following:-
    Make the Finder the front App (listed in the menu bar)
    Use the Go Menu
    Hold down the ALT key and select the Library at appears.
    Open Preferences
    Find the file com.apple.imservice.iMessages.plist
    Drag it to the Trash
    Restart Messages
    You may have to reset the iMessages/Apple ID up again but the "extras" should be gone.
    10:20 PM      Monday; September 3, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Deleted user is back, is it possible?

    I remember that I deleted a user from a group inside a sub site. After a while when I viewed users inside the group, I see that the user is back and he is there. Is it possible that removed user be back to a site or group? What do you do if you want to
    do not share a site with a user any more? thanks and appreciate all kind of advice.

    You verified that through auditing? Auditing is going to tell you who or what process added the user. Without that information, there isn't much we can do but guess.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • When U2 launched their latest album it was downloaded to all iTunes users free of charge.  It does not seem to be possible to delete any or all of these tracks.  Can anybody tell me how to delete these tracks?

    When U2 launched their latest album it was downloaded to all iTunes users free of charge.  It does not seem to be possible to delete any or all of these tracks.  Can anybody tell me how to delete these tracks?

    Hi SJHocking,
    Welcome to the Apple Support Communities!
    If you would like to remove the iTunes gift album “Songs of Innocence”, please follow the instructions outlined in the attached article. 
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases - Apple Support
    Cheers,
    Joe

  • Deleting Users in EBS r12.1.1   Is it possible?

    Hello everyone,
    I am a junior QA engineering that has been given the task to learn about EBS(E-Business Suite) r12.1.1. I am very new to EBS, and have never worked on any other ERP software.
    I would like to know if there is a way to delete users that I create. When I try to delete a user it doesn’t actually remove the user entry. It suspends/suspends the user.
    Is there a way to delete user accounts from the EBS user store/database?
    Thank you.
    Regards,
    Marc

    Hi,
    Applications users cannot be deleted since records belonging to users are kept for security and monitoring purposes (same applied for responsibilities). In addition, the user is recorded in Who columns, so deleting would cause foreign table data integrity issues.
    delete a responsability
    delete a responsability
    reponsibilities and users
    Re:reponsibilities and users
    Regards,
    Hussein

  • Cannot delete users from the Central Management Console

    I cannot delete users from the Central Management Console.  I'm logged in to Enterprise as administrator but still get the following error:
    There was an error while writing data back to the server: Sorry, you do not have the right to 'Delete objects' (id - 22) for 'koberg' (id - 725415). Please contact your system or permissions administrator if you require this right.
    Thanks in advance for any help on this matter.

    Oops, my mistake, sorry. Ok, so the Administrator cannot delete user koberg.
    Check top level:
    Logon to CMC, browse to Home > Settings and select the Rights tab. These are your top level settings. Factory default will show only Administrators and Everyone. Select the Net Access "Advanced" for the Administrators group. NB: Do not select these group names links - they will jump you out of the top level! On the Advanced rights page, ensure the right to "Delete objects" is explicitly granted.
    Then set for the Users top level folder:
    In the CMC, browse to Home, and select Users. Select the "Rights" button. Again - NB: Do not select these group names links - they will jump you out of the Users top level folder! Set the Administrators group to "Full Control". Save.
    That should be all you need. However, there is a possibility the previous admin was busy setting security not only at the account level, but on groups so we need to verify the user:
    In the CMC, browse to Home, and select Users. In the User list, select koberg. In the koberg account page, select the Rights tab. If the Administrators is not set to (Inherited Rights), make it so, and when you select the "Update" button, you should see the Net Access update to "Full Control". If this is the case, you should follow these steps on each account and accomplish this.
    And if you still can't delete it, verify the groups:
    In the CMC, browse to Home, and select Users. In the User list, select koberg. In the koberg account page, select the "Member of" tab. Note all groups koberg is a member of. Then in the CMC, browse to Home, and select Groups. Select the name hyperlink for the group(s) that koberg belongs to. On the group page, select the Rights tab, and ensure the Administrators have (Inherited Rights) - Full Control on all of these, also. If not, set it.
    Finally, I know you inherited this, but let's overview some basics of simplifying your deployment administration. Follow these guidelines, and your administration life will be so much easier.
    1. The Everyone group should never have any subgroups. Ever. All accounts on the system are a member of the Everyone group. Adding subgroups to the Everyone group is redundant.
    2. For simplicity's sake, Application level access should be set on the Adminstrators Group, and the Everyone group. I know there are customers who add groups to application rights. I don't understand why users would have an account on the system if they are not allowed access to InfoView, but it's your system.
    3. From a report object perspective, the Everyone group should be set at the top level to "No Access". This will result in them having no rights on anything at all. You break this inheritance at the application level to give them access to InfoView and other apps. On folders and objects, you ADD groups, then assign (ADD) rights as desired.
    4. If you can help it, never explicitly deny a right to any user or group for any object or application. Explicitly deny overrides any other setting. If a user belongs to group A and group B, and group A is explicitly denied a right, you can explicitly grant it for group B or the user all day long, and it will still be denied. Always try to put yourself in the position of adding groups/users, and adding rights, then inheriting as far down the folder tree as you can.

  • Not Enough Hard Drive Space on my Mac Mini to Save Deleted User Account Folder: What to do?

    I am no longer able to access my original user account on my mac mini because the account is corrupted and won't load. Thanks to the helpful advice I found on the internet, I was able to create a new user account and resume using my mac, but all of my old files are trapped in the old user account.
    The plan was to delete the old user account, create a disk image of the old account folders, and then migrate those folders to the new user account. Unfortunately, I don't have enough disc space left on my Mac to do that. I have just under 11gb left after deleting absolutely everything I could, and I need 81gb for the old user files. The back up plan was to select the "don't change the home folder" option, but when I went to delete the account, there was no such option. The message simply read:
    "The user's home folder will not be saved. To do so, you need 81.1gb of free disk space. Try emptying the trash or deleting other files on your disk, then deleting the user account. If you do not want to save the user's home folder, click delete immediately."
    My only two choices were CANCEL or DELETE IMMEDIATELY. There was no "don't change the home folder" option.
    So I am not sure how to proceed. Here are some questions:
    1) is there a way to save the disk image directly to an external drive instead of the user's folder on the mac hard drive?
    2) If I use the "delete immediately" option, will the files go into a "deleted users" folder where they can be recovered or will they just be erased from the computer and unretrievable?
    3) Is there a way to use terminal to change access permission on the original user account files so that I can copy them onto an external drive or integrate them with the new user account without having to first delete the original user account?
    4) In the absence of deleting the user account, will using either:
    sudo chown -R `id -un` /Users/oldusername
    and/or
    sudo chmod -R u+rw /Users/oldusername
    in Terminal allow the new user account permission to access the original user files and merge them seamlessly into my new user account? Or must I delete the original account first?
    5) Is there something else I haven't thought of that would work, would be more efficient, or more effective? This wouldn't be the first time I have overthought a solution...
    When considering any solutions, please keep in mind that I cannot launch the original user account as that starts the whole endless loading loop. So, while I have the password for the original user account, any solution would appear to require that I work from the new user account only, without launching the old account.  Also I am a complete newbie at this. I've used Macs exclusively for 17 years but this is the first time I've had to do anything like this. Up to now, everything has always "just worked".  So please be as detailed with any instructions as possible!
    Any help greatly appreciated.  Thanks!
    Mac Mini 2ghz 1g ram running OS 10.4.11

    I think ComputerFixer is correct, you should be able to drag and drop it to another drive, no worries. However, if not, you could create an disk image of it using DiskUtility and create it on a new drive. But again, I don't think that is necessary. If you have administrator rights with your new account, can you simply go into the old user account folder and drag and drop the files you want to save? I have done that as well as copy the older user account to another drive (in my case, another computer on the network) and salgage my files from there. Is that an option for you?

  • Deleted User recovery  in SAP R/3

    Hi :
    By mistakenly I have deleted user from the user list . After some time i came to know that , that user is productive user.
    Can any one help me for how to recover the user from deleted list.
    Thanks
    Chimsi

    Hi,
    I do not think that will be possible. You can recreate the same user-id though, and he/she shall be able to carry on (get the workflow items, inbox, transport requests and so on, of the earlier user-id).
    It maybe possible to search CDHDR and CDPOS tables to get some details of user deletion.
    cheers,

  • URGENT! I need help on LDAP - Finding deleted users Attribute "sAMAccount"

    Hi,
    I am trying to get deleted users from Active Directory after a certain interval. Every time only the differences in the result will be shown. Also I need to get the value of the specific attribute called "sAMAccount" every time for each user(in the result).
    I am using polling here.
    *if (localCookie == null) {*
                        // Specify the DirSync Control
                        *Control[] ctls = new Control[] { new DirSyncControl() };*
                        ctx.setRequestControls(ctls);
                   *} else {*
                        // Specify the DirSync Control with cookie
                        *Control[] ctls = { new DirSyncControl(1, Integer.MAX_VALUE, localCookie, true) };*
                        ctx.setRequestControls(ctls);
    rspCtls = ctx.getResponseControls();
    *if (rspCtls != null) {*
                   *for (int i = 0; i < rspCtls.length; i++) {*
                        *if (rspCtls[i] instanceof DirSyncResponseControl) {*
                             *DirSyncResponseControl rspCtl = (DirSyncResponseControl) rspCtls;*
                             localCookie = rspCtl.getCookie();
    The typical problem I am facing here is 2nd iteration onwards the result is not fetching the attribute "sAMAccount".
    Please suggest the possible reason and solution.

    String searchBase = "DC=test,DC=com";
    String searchString = "(&(objectClass=user)(|(givenName=*)(isDeleted=TRUE)))";
    String url = "ldap://jbaitest.test.com:389";
    String initCntxtFact = "com.sun.jndi.ldap.LdapCtxFactory";
    String login= "CN=Administrator,CN=Users,DC=TEST,DC=COM";
    String passwd = "welcome@1";
    byte[] localCookie = AdPolling.getCookie();
    try {
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, initCntxtFact);
        env.put(Context.SECURITY_AUTHENTICATION, AdConstant.SECURITY_AUTH_TYPE_SIMPLE);
        env.put(Context.SECURITY_PRINCIPAL, login);
        env.put(Context.SECURITY_CREDENTIALS, passwd);
        env.put(Context.PROVIDER_URL, url);
        LdapContext ctx = new InitialLdapContext(env, null);
        SearchControls searchCtls = new SearchControls();
        String returnedAtts[] = null;
        searchCtls.setReturningAttributes(returnedAtts);
        searchCtls.setReturningObjFlag(true);
        searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
        if (localCookie == null) {
            Control[] ctls = new Control[] { new DirSyncControl() };
            ctx.setRequestControls(ctls);
        } else {
         // Specify the DirSync Control with cookie
         Control[] ctls = { new DirSyncControl(1, Integer.MAX_VALUE, localCookie, true) };
         ctx.setRequestControls(ctls);
        NamingEnumeration enumSearchResult = ctx.search(searchBase, searchString, searchCtls);
        AdRestClientConnector adRestCon = populateUsers(enumSearchResult); // Method to get the different  attribute values
        rspCtls = ctx.getResponseControls();
        if (rspCtls != null) {
         for (int i = 0; i < rspCtls.length; i++) {
             if (rspCtls[i] instanceof DirSyncResponseControl) {
              DirSyncResponseControl rspCtl = (DirSyncResponseControl) rspCtls;
              localCookie = rspCtl.getCookie();
    AdPolling.setCookie(localCookie);
    } catch (NamingException e) {
         log.error(AdConstant.ERROR_SEARCHING_DIR_PROBLEM + e);
    } catch (Exception e) {
         log.error(AdConstant.ERROR_SEARCHING_DIR_PROBLEM + e);

  • Is it possible to Delete BP's from production system

    Hi All,
    Is it possible to delete old BP numbers from production system?
    if yes please let me know the procedure and impact on the system.
    if no please let me know ,how to prevent user from entering old BP number into order.
    Thanks in advance for your help.
    Regards,
    Shaik

    Hi Shaik,
    You can delete the BP using transaction BUPA_DEL.
    Just enter the number of the BP you want to delete and then execute.
    Make sure that all the checkboxes on the selecton screen are clear.
    In case the BP has dependencies and deletion is not alowed, you will get an error message informing you of the same.
    Best Regards,
    Rishu.

  • Cannot print PO created by deleted User ID

    Hi Gurus,
    May i know if there's a way how to print a PO if the User ID create the PO already deleted because he/she leave in the organization?
    We change the PO created by the deleted User ID and after that we can't print the PO, please suggest possible solution to this case.
    Thanks
    Marina

    Hi Marina,
    It seems that your print program calls/accesses information for the user who created the purchase order. I am assuming that your PO contains purchaser specific information such as his name, contact numbers, etc. Now, since you mentioned that the user id has already been deleted, then whenever the print program is called and tries to check the PO creator, it will see no data.
    If I may suggest, copy the old purchase order using the user id of a currently existing employee. I am assuming that since this user already exists, then the print program can successfully access the needed address information. Kindly check if this is allowed by your business polices.
    Best regards,
    DeLo

  • Is it possible to delete bank details in Mantain Insurance Relationships Proposal Pool?

    Hello,
    We are on SAPK-60614INISH (SAP healtchare Support Package 14)
    is it possible to delete bank details in Mantain Insurance Relationships Proposal Pool?
    In Mantain Insurance Relationships Proposal Pool, there is no button to erase bank details
    It is easier for the user to delete bank details in Mantain Insurance Relationships Proposal Pool than in FD02 Change
    Thanks in advance
    Best Regards

    To the best of my knowledge, not on an unjailbroken phone using the stock Messages app.

  • What is the best way to automatically delete user profiles after x days of inactivity (school lab environment)?

    I work at a school where we have multiple Mac Carts that have 30 MacBooks per cart. We image the macs every summer to delete the older user profiles but we are looking for way to possible have this done automatically through out the year to help with HDD space. What is the best way to delete user profiles after...say 180 days.... of inactivity automatically? I am open to login hooks, bash scripts, etc. Anything to get the job done. Thanks for any help or advice.

    A search here turned up this post Deleting inactive users
    It appears that the script posted will do as advertised though I would test it out on your systems and under your conditions to see if it does do what you need.
    regards
    Message was edited by: Frank Caggiano - That script looks for users over 21 days. To look for ones over 180 days change the 21 to 180 in the find command.

  • CUA- Deleting user IDs from Child systems

    Is there a possibility of configuring CUA in such a way that user IDs can be created and access can be updated from CUA but deleting user IDs should be taking place only in the child system (Not in all the child systems)?

    Generally good advice to keep the uniqueness of UIDs over time, also after Elvis has left the building
    What you could consider is a CUA RFC user which is not authorized to delete UID's and schedule a purge job for those IDOCs which deleted only them.
    However these sorts of "workaround" solutions are not the best advise, to be honest. What happens it someone temporarily assigns SAP_ALL because there is a big problem and authorizations should be excluded as the cause to get it working again?
    Also, every time a new child system is added to the CUA you will be flooded.
    My advice: Rather change your procedure (as discribed by Jurgen).
    What would be interesting to test is whether you are authorized to move a user (change the authorization relevevant group which they currently have) to a group which the CUA user is no long able to subsequently administrate? But theen you will still be hunting down IDOCs from time to time, most likely.
    If your shop is big enough to have these systems you have described, then you might want to consider an IdM system to replace your CUA at some time.
    If you wish, I will move this thread to the IdM forum.
    Cheers,
    Julius
    ps: Please do not cross-post.

Maybe you are looking for

  • The Mini DisplayPort to VGA Adapter does not detect my external monitor.

    Processor  2.5 GHz Intel Core i5 Memory  12 GB 1333 MHz DDR3 Graphics  AMD Radeon HD 6750M 512 MB Software  Mac OS X Lion 10.7.4 I just purchased this dongle, and when I plug it into my thunderbolt port it doesnt do anything. It works for my MBP 2012

  • How to replace or change SCCM 2012 R2 install account

    Hello, If we have a need to off-board/replace/change the user (Bob) who originally installed SCCM with, what would the reprocussions of such action be? Anyone attempted to do such a thing before? Is this 'supported'? Details: This user used their 'ex

  • My ipad is telling me it is synced with another computer which is not possible.

    I was trying to sync my bookmarks between safari on my computer and my ipad. I plugged my ipad into my computer to check the settings in itunes. I then noticed that i had not set my books to be synced between itunes and my ipad. When i tried to sync

  • Selection-screen in module program

    Hi, I have created a module pool prog. Now the new regd. is that I want to create selection-screen before displying the actual screen. But when I m trying to use selection screen then I m getting the message that it is not possible in type 'M' as my

  • ABAP+Java Kernel

    Hi, I have installed solution manager 4.0 with a java instance. i want to upgrade the system's kernel. how do i upgrade an abap+java kernel  - is it the same like upgrading a regular kernel? i'm running a unicode system.