Code(Adapter) for Checking User's Manager in AD

I am trying to make a code to be used as an adapter and use that adapter before create user task... The process should first check the presence of manager id in Microsoft AD(target system), if present then create the user....
Can anyone help me????????

Hi,
You can have code something like this. You need to choose a manager attribute for example: employee number to search for manager in any LDAP.
public static DirContext getConn(String Address, String dn, String root,
               String pwd, int port, boolean SSL) throws Exception {          
          Hashtable<String, String> env = new Hashtable<String, String>();
          String url = "ldap://" + Address + ":" + port + "/" + root;
          env.put(Context.INITIAL_CONTEXT_FACTORY, com.sun.jndi.ldap.LdapCtxFactory);
          env.put(Context.PROVIDER_URL, url);
          env.put(Context.SECURITY_AUTHENTICATION,"simple");
          env.put(Context.SECURITY_PRINCIPAL,dn);
          env.put(Context.SECURITY_CREDENTIALS,pwd);
          if(SSL) {
               env.put(Context.SECURITY_PROTOCOL,"ssl");
          DirContext dirContext = new InitialDirContext(env);
          return dirContext;
public String ManagerExists (Long processInstanceKey, String managerAttribute) {          
                    DirContext adContext = getConn(Address, uid, root, passwd, port, SSL);
                    String managerExists= "No";String searchBase="";
                    String filter = "managerAttribute="+managerAttribute;                                                       
                                        SearchControls searchControls = new SearchControls();
          searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
          NamingEnumeration namingEnumeration = adminDirContext.search(searchBase, filter, searchControls);
          if (namingEnumeration == null) {
               managerExists="No";
          while (namingEnumeration.hasMoreElements()) {
               managerExists="Yes";
          return managerExists;
Hope this helps.
regards,
GP

Similar Messages

  • 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

  • Using Oracle Apps Adapter for apps_applcon user

    Hi,
    We are trying to use oracle apps adapter for our BPEL flows using FM11g (Jdev11gR1). We came to know that it will work for only apps user.
    We have apps_applcon user. How can we use that?
    Is there any way we can tell oracle apps adapter to user apps_applcon user?
    Any help would be greatly appreciated.
    Thanks in advance.
    Thanks & Regards,
    Rama Krishna. P

    We also have same requirement. We have BPEL connection using custom oracle user, xx_b2b and when we use APPS adapter, I can not see and use any business event.
    If anybody across same requirement, please share your experience.
    Appreciate help on this.
    Thanks,
    Sonartori

  • Seek easy and safe way for average users to manage the contents of Portal.

    Dear all,
    My boss today requested me to provide a easy, safe way for average users in my company to manage the contents of Portal themselves.
    My boss request users can upload files, documents, images and text into Portal.
    I know that Oracle Portal provides security control for editing Portal. But it also provides a quite complex operations for manage the contents of Portal.
    I am afraid average users cannot manage it easily.
    Can anyone have experience on the issues and can you give me suggestion?
    Thanks a lot
    George (HK)

    Hi Vijay.B,
    We can give privileges to manage the contents of the portal page.
    Create a group and add the users into that group and for the page level privilege >>add this group as manage.
    The members of the group can manage the page.I know the above is the standard strategy for users to manage the portal contents.
    But, as an average user, I think it is still to complicated to manage.
    For my case, I need to provide a means for average users to add news to the portal, so my priliminary idea is that I will create a portlet for news entries such as news heading, hyperlinks, text and save the entries in DB. Then, on the homepage of Portal, I will create another portlet for displaying the news headlines with hyperlink pointing to the actual URL.
    thanks
    George
    Regards,
    Vijay.B

  • Enable Enterprise Voice for all users excpet management

    Hi,
    I want to disable enterprise voice for all users except managers.
    I want to do this through PowerShell. 
    Mashhour Faraj

    Hi 
    Here is the command to list all the Enterprise voice enabled users 
    GET-CSUser | Where { $_.EnterpriseVoiceEnabled }
    Get-CsADUser -OU "OU=Test,dc=contoso,dc=com" | Disable-CsUser -RegistrarPool pool1.contoso.com -SipAddressType FirstLastName
    To Disable all Enterprise voice Enabled users
    $GetUsers=get-CsUser -Identity "* *" -OU "OU=Test,dc=contoso,dc=com"
    foreach($User in $GetUsers)
    $DN=$User.DisplayName
    Set-CsUser -Identity $DN -EnterpriseVoiceEnabled $False 
    Whenever you see a helpful reply, click on Vote As Helpful & click on Mark As Answer if a post answers your question.

  • What is code needed to check user fill in? Please help!

    Hi all,
    I need to check the data that users fill in (in multi record block) so that it is increasing number. For example:
    100000
    100001
    100003
    100010
    100011
    I want to put this code at Post-Item trigger so that an alert will flash the moment users finished entering an item and it is less number than previous_item. How do I achieve this in Form 6i?
    Thanks in advance for any tip.

    have a form level parameter.
    Put the value of the first field into this parameter in its post item.
    in the next item post item just check if its value is larger then the parameter. if it is set the parameter to its new value.

  • CoreDAVErrorDomain Code=3 for Lion user

    So, up until oh.. today our office was getting along just fine and dandy with iCal. People were syncing on mobile devices, on their desktops, laptops and so forth. Mostly Snow Leopard, by the way, and one user who had already upgraded to Lion. Things had been working just fine, again, up until now.
    The error reported back on the user's Macbook Pro is this: The request (CalDAVAccountRefreshQueuableOperation) for account "so and so" failed.
    2/14/12 2:53:49.340 PM iCal: Account refresh failed with error: Error Domain=CoreDAVErrorDomainCode=3 "The operation couldn't be completed. (CoreDAVErrorDomain error 3.)" UserInfo=0x7ff03437b530 (AccountName=soandso, CalDAVErrFromRefresh=YES}
    Things I've tried:
    Deleted said account from iCal preferences, and readded it. Dumped and rebuilt CalendarCache, also the main iCal plist file.
    Ran disk permission verification and repair.
    Seems to be only with this laptop with Lion that it's happening as every other computer/user is having no issue.

    Its because MKPF-MBLNR does not have a Searh Help.
    You can create your own search help and add it in program in AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field> event.
    You can get ample of sample codes in SCN on this.
    -SS

  • Error Code A12E1 for MAC Users

    Hello Creative Cloud,
    I recently installed Creative Cloud on my Mac. All worked OK initially.
    But then there was a problem with an upgrade and I now get Error Code A12E1.
    Can anyone help please ?
    Many thanks
    freedriv

    Hi freedriv,
    Please try the below mentioned steps:
    1. Navigate to Library/Application Support/Adobe/OOBE and rename it to OOBE.old
    2. Navigate to Application/Utilities and remove Adobe Application Manager and Creative Cloud folder.
    3. Open Activity monitor and close any Adobe processes running.
    4. Restart your machine and try installing CC desktop.
    Please let me know whether it worked.
    Regards,
    Romit Sinha

  • Script for check users password's expiry and email it to respective users

    Hi,
    I am a beginner in Solaris environment. Anyone have sample script to read password's expiry and email it to respective users ?
    Thanks in Advance.
    Sincerely,
    Daniel

    If you don't want to be constrained by keeping your videos super small so they can fit in an email, there are several solutions:
    1) Get a .mac account and use Web Gallery ($)
    2) Use Youtube and include a link to the video in your email (free)
    3) Use Google Video and include a link to the video in your email (free)
    4) Use VIMEO and include a link to the video in your email (free)
    There are several other video hosting services but you get the idea.

  • Abap Code help for retreiving user ID

    Hi All,
    I have a field N_BPIID(this field contains User IDs of Users) and variable on this field Z_PIID(Customer exit)...........
    My requirement is
    When i execute the report -
    this variable Z_PIID should automatically  retrive his ID frm BI/BW system..............
    Please suggest
    Edited by: Raj on Jan 12, 2010 4:59 AM

    Hi,
    A user that is signed on - system will populate field sy-uname - Not sure of your logic.In STEP 3 of your CMOD you could say :
    Eg : If user is not user "USERABC" then dont allow them into queries.
    Hope this helps    Colin
    IF sy-uname+0(7) <> 'USERABC'.
          L_AUTH = 0.
          EXIT.
        ENDIF.
      if sy-subrc <> 0.
        CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
          EXPORTING
            I_CLASS  = 'RSBBS'
            I_TYPE   = 'E'
            I_NUMBER = '013'
            I_MSGV1  = 'Insufficient authorisation'.
        RAISE wrong_entry.
      endif.

  • Make XFCE4 default for all users

    I got Arch up and running with XFCE4. its great so far
    I am using either xdm or wdm as my login manager (havent decided which i want yet)
    I added a ".xinitrc" file to my home folder so that XFCE4 will start when I log in. is there a way to make XFCE4 the default wm for all new users without having to add a .xinitrc file to all of their home folders? I only plan on using XFCE4 so I dont need the login manager to load other wm's. but i would like to be able to add users and have their session automatically start as XCFE. all i have found by googling and on LQ.org is making a .xinitrc file, but these seem to lean toward a single user system. there has to be an easier way, ie with fedora when you make a new user, log out and log in as the new user and it will start  the default wm, or you can choose whichever wm you want to use.
    im using arch 0.7.2 'gimmick' and all packages have been updated

    If you just edit the skeleton file for <code>.xinitrc</code>, then for each user that is created, it will automatically be set to run xfce.  The location of the file is <code>/etc/skel/.xinitrc</code> if that answers your question.

  • Checking User exits in use

    Hi all,
    we are moving to ECC 6.0 from 4.6C. I have a list of all user exits. How can i check that these exits are in use or not? Please help.
    Regards,
    AI.

    For checking user exits go to that particular transaction code there in the menu bar go system-----> status
    There u will gat the program of  that T.code
    double click on  that one then in the menu bar go to  utilities -
    > attributes,
    Form there get the pakage of thet program
    then go to SE80
    There in the left and side expand modifications and enhancments  in the right side enter pakage name then u will get all the user exits related to that particular tarnsaction
    Regards,
    Prasad

  • Oracle Adapter for SAP

    Respected Guys
    I have an oracle-9i database connected with SAP and wants to transfer data from oracle9i database connected with SAP to an another oracle-9i database which is connected with a GPRS system.
    Data about only sales has to be transfered from SAP to GPRS database (Oracle9i). I want to know the procudre of transfering data from SAP to GPRS database.
    I know there is an Oracle9i Adapter which is used for this purpose. Anyone know about how to use the Idocs or ALE for this purpose.Or if anyone is aware of use of Oracle9i Adapeter. We are using Oralce9i with SAP4.6 and the database connected with GPRS is also oracle9i.
    http://www.oracle.com/technology/products/integration/adapters/pdf/DS_OracleASAdapter_SAP.pdf
    Thnx

    Hi,
    I checked the following document under the section: Adapter Features / Supported Versions and Platforms.
    Oracle® Application Server Adapter for SAP User's Guide 10g Release 3 (10.1.3.1.0)
    I could find that the SAP 6.0 is supported by the adapter that comes with OAS 10.1.3.1
    Thanks,
    Sasi Bhushan

  • Two purchasing organisations for one user

    Hi Experts,
    We are running SRM 4.0, extended classic scenario with a large international setup.
    I have an issue with purchaser that need to be able to shop for two different pur. orgs. in two different company codes (A & B).
    I have added both A & B in the Company Code attribute for the user.
    And I have made both the local purchasing groups for A & B responsible for the purchaser.
    When I create a SC I can select whether to use Company code A & B and I can select the matching Purchasing Group. When I finish the shopping cart the order is created in SRM with correct the Local Purchasing Organisation which the Pur. Group I chose belongs to.
    But when it is tranfered to R/3 it is allways assigning pur. org. A. (also if the order in SRM has local pur. org. B). This results in a error, if the purchase wants to make a purchase for Company B.
    Is it not possible in SRM to able to chose more than one backend pur. org.?

    Hej igen, Anders.
    I don't suppose you have found a solution here?
    What I was thinking is, that you should try using the GUID of the purchase order from SRM and use it in the function module BBP_PD_PO_TRANSFER_EXEC_V2 to test which data are getting sent from SRM to R/3. You know you can find the GUID of the PO from transaction BBP_PD with BUS2201, and this GUID is the only thing needed to test the function module. This FM is sending your shopping cart/PO data from SRM to R/3, so if you can debug this to see that here the p org is correct, you would know that the error occurs in R/3.
    On the other hand you could also see in BBP_PD for the purchase order in SRM if the p org is already wrong here?
    Cross buying is possible, so hopefully you get to find your error. Otherwise post a reply here, we'll figure something else out.
    BR
    Dennis

  • Checking user permission doubt

    Hi everyone,
    I have posted a question yesterday, but I have no right answer. I want to try again, please help me. It is urgent! I thank in advance.
    I am developing a recursive tree in a Web Dynpro App. My tree has some nodes and sub nodes. Under the sub nodes I have documents. These documents are composed of header, footer, address, content and so on, which are loaded in runtime from Backend system. There is possible that thousand documents can be attached to a node. For accessing the documents we need to check the permission of the user. There are users who may read the whole content of a document. There are users who may only read parts of the document. For example, the information about salary of an employee shouldn't be read by every user. How can I check the user permission? Has someone any Suggestion?
    Regards,
    Hairong

    Hi William,
    thank you very much for your answer.
    I haven't worked with ACL. With your answer, I hava read something about ACL. It is used for checking user permissions for accessing portal content.We have no portal now. Our application is standalone application. Do you know what is a connection between reqular UME permission and UME ACL permission?
    By the way, we use UME to store our user profile. We have already tried to check user permission only for UME role of the user. We have also tried to follow the concept like the Web Dynpro tutorial RentCar APP with Actions and permissions. But all these can't resolve our problem really, because we can't create for every document a role or a permisson.
    here, ich want also to thank Atul who had me an answer to my question.
    Best regards,
    Hairong

Maybe you are looking for

  • External monitor - clone or larger desktop

    Hello all, still deciding (actually my mind is already made up...) to buy a macbook. One question remains, can i use my external monitor as a second display, so it enlarges my desktop (for example for my photoshop-tools etc.) or is it only possible t

  • API' s in Oracle HRMS

    Hi, Please let me know where can i get the list API's in Oracle HRMS Thanks Rakesh

  • AE 2014 - ray trace 3D looks fine in edit, doesn't render depth

    I am editing some 3D text and have my comp settings to use the ray trace engine. All looks good as I edit, but when I render the text is flat 2D. Attached are samples. What's going on? This is what I see when editing in the comp window. This is how i

  • Illustrator also saves a new .ai file  when saving with batch

    When saving for Web as .png with a batch, illustrator also saves a new .ai file. The batch opens the .ai files from a specific map and saves them in another map. Is there a reason that illustrator does this ? Now I have to delete all the .ai files fr

  • NetWeaver & ADS Issue

    I am new to SAP and still learning but we I have found a error that I am not able to resolve it has to with ADS here is the output from the Web Application. com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Fa