Using LDAP query to get all the domains from all the forests in my company

Foreword:
I'm using two domain controller (dc1 and dc2). I'm using a domain registered to the root domain dc1 and simply request all of the domains in its forest by preforming search in the CN=Partitions,CN=Configuration,DC=dc1,dc=local.
I can also get the root domain dns of my trusted forest (dc2) from the default naming context under "CN=System" by looking for an object of type "trustedDomain".
The problem:
The problem is that I can't see/find the other domains (childs) of the root domain dc2 from the active directory information found in dc1. In order to get these domains I currently bind to this domain controller (dc2) and preform the same search as I did in
the domain controller dc1 (CN=Partitions,CN=Configuration,DC=dc2,dc=local) to get all its childs.
Must I use this binding to each root domain in other forest in order to request all of its domains? Is there a better way to do it? I read about referrals which seems like a solution to my problem but I'm not sure if it is and I'm not sure how it should be
used.
Note : I'm using the DirectoryEntry class in C#.

Hello,
>> read about referrals which seems like a solution to my problem but I'm not sure if it is and I'm not sure how it should be used.
Here are some information I found on the MSDN which might help you:
Active Directory Searches Processes and Interactions
Avoid unnecessary SearchResultReference referral chasing
In the thread below, there is a code snpont shows the usage of this property:
https://social.technet.microsoft.com/Forums/windowsserver/en-US/fb338aed-4172-4132-a85e-f9bebdb74e00/when-does-adsi-refferal-chasing-work-?forum=winserverDS
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Query for getting all function and procedure inside the packages

    hi All
    Please provide me Query for getting all function and procedure inside the packages
    thanks

    As Todd said, you can use user_arguments data dictionary or you can join user_objects and user_procedures like below to get the name of the packaged function and procedure names.
    If you are looking for the packaged procedures and functions source then use user_source data dictionary
    select a.object_name,a.procedure_name from user_procedures a,
                  user_objects b
    where a.object_name is not null
    and a.procedure_name is not null
    and b.object_type='PACKAGE'        
    and a.object_name=b.object_name

  • Query to get all ports assigned and used by EBS instance.

    Hi,
    Can some one pleaase help to get
    Query to get all ports assigned and used by EBS instance.
    Help is appreaciated.
    Regards,
    Milan

    MILAN RATHOD wrote:
    Hi,
    Can some one pleaase help to get
    Query to get all ports assigned and used by EBS instance.
    Help is appreaciated.
    Regards,
    MilanIn addition to the thread referenced above by Helios, please check the context files and (Oracle E-Business Suite R12 Configuration in a DMZ [ID 380490.1] -- F. List of Ports to Open in a DMZ Configuration).
    Thanks,
    Hussein

  • Oracle query to get all occurences of a text in a string

    Hi
    Does anybody know how to write a query to get all occurences of a text in a string in different rows of the table
    For eg:
    I have a string <aa>bb</aa><aa>cc</aa><aa>ddd</aa>
    I have to find every occurence of <aa> and get the data between <aa> and </aa>
    So the output should be
    bb
    cc
    ddd
    I think this can be done by using a regular expression but I dont know how.
    Can anyone help me?
    Thanks in advance.

    user2360027 wrote:
    BluShadow,
    The query gives correct results if i only have <aa></aa>
    What if i have <ff></ff>?
    Example:
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa><ff>dsd</ff>
    I want to have the following (dsd should not be there in the result)
    bb
    cc
    dddThis is a new requirement and not what you asked for in your original post. Perhaps you should tell us exactly what you are trying to achieve and what database version you are using to save us guessing.
    To crokitta,
    This version will deal with multiple rows..
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select '<aa>bb</aa><aa>cc</aa><aa>ddd</aa>' as x from dual union all
      2             select '<aa>xx</aa><aa>yy</aa>' from dual)
      3  -- end of test data
      4  select x, vals
      5  from (
      6    select x, regexp_replace(REGEXP_SUBSTR (x, '>[^<]+', 1, lvl),'[<>]') as vals
      7    from t
      8        ,(select level lvl from dual connect by level <= (select max(length(regexp_replace(x,'[^>]*'))/2) from t))
      9    )
    10  where vals is not null
    11* order by 1,2
    SQL> /
    X                                  VALS
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa> bb
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa> cc
    <aa>bb</aa><aa>cc</aa><aa>ddd</aa> ddd
    <aa>xx</aa><aa>yy</aa>             xx
    <aa>xx</aa><aa>yy</aa>             yy
    SQL>

  • TS4036 if i go into icloud on my phone then manage storage, i can see i have a 252.6 back up from my old iphone 5 (that i have now lost) i want to use this backup to get all my photos back but when i click on it, it says Latest back up Incomplete????????

    if i go into icloud on my phone then manage storage, i can see i have a 252.6 back up from my old iphone 5 (that i have now lost) i want to use this backup to get all my photos back but when i click on it, it says Latest back up Incomplete????????
    am i out of luck of can i do something??

    I'm afraid you're out of luck.  If it says incomplete you won't be able to access the backup.

  • SQL Query to get All AD Groups and its users in Active Directory

    Hi,
       Is there any query to get all AD groups and its user in an instance of a SQL server?

    Check this blog.
    http://www.mikefal.net/2011/04/18/monday-scripts-%E2%80%93-xp_logininfo/
    It will give you more than what is required. If you dont want the extra information,then you can try this.. I took the query and removed the bits that you might not require.
    declare @winlogins table
    (acct_name sysname,
    acct_type varchar(10),
    act_priv varchar(10),
    login_name sysname,
    perm_path sysname)
    declare @group sysname
    declare recscan cursor for
    select name from sys.server_principals
    where type = 'G' and name not like 'NT%'
    open recscan
    fetch next from recscan into @group
    while @@FETCH_STATUS = 0
    begin
    insert into @winlogins
    exec xp_logininfo @group,'members'
    fetch next from recscan into @group
    end
    close recscan
    deallocate recscan
    select
    u.name,
    u.type_desc,
    wl.login_name,
    wl.acct_type
    from sys.server_principals u
    inner join @winlogins wl on u.name = wl.perm_path
    where u.type = 'G'
    order by u.name,wl.login_name
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Unable to open windows using boot camp.  Get message "The bless tool was unable to set the current boot disk."  Any thoughts, Thank you.

    Unable to open windows using boot camp.  Get message "The bless tool was unable to set the current boot disk."   I am using an Imac , Lion operating system, and Windows 7.  It worked a few days ago.  Any thoughts, Thank you.

    Note that nowhere in the Boot Camp instructions does it tell you to use Disk Utility to format the Windows partition. The Boot Camp Assistant program creates the partition & sets the +partition scheme info+ of the disk as appropriate for the Windows installer but the Windows installer itself is responsible for formatting the new partition with the appropriate +file system scheme+ (NTFS for Windows 7).
    If you follow the instructions in the Boot Camp Installation & Setup Guide to the letter you should have no problems installing Windows.

  • My ipad is connected to my wifi, however when i try to sign my ipad into facetime is says that it is having trouble connecting. I use my wifi to get on the internet on my iPad so i have no idea what the problem is. Help Me

    My ipad is connected to my wifi, however when i try to sign my ipad into facetime is says that it is having trouble connecting. I use my wifi to get on the internet on my iPad so i have no idea what the problem is. Help Me

    - Did it successfully connect to the network before?
    - Do other devices successfully connect to the network now?
    - Does you iPod successfully connect to other networks?
    - Have you reset your iPod?
    Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Reset network connections: Settings>General>Reset>Reset Network Settings
    - Powered off and then back on your router
    - The troubleshooting here:
    iPhone and iPod touch: Troubleshooting Wi-Fi networks and connections
    -When you restored you iPod did you restore to factory defaults/new iPod?  If not try that.
    - If you look at the network properties on the iPod what IP address is assigned when you think you are connected but actually have no internet connection.  If it starts with 169 then the iPod never connected to the router, the 169 address are self assigned.

  • Getting group members using ldap query

    I need help writing an LDAP query for iPlanet to retrieve all the members of a group. I can do it on Active Directory using the following :
    (memberof=CN=SundanceGroup,CN=Users,DC=Test,DC=com)
    But I am not able to do it with iPlanet. Please let me know how to do it.
    Thanks,
    Binu

    "memberof" attribute is not supported by iPlanet. try using "uniquemember" attribute instead. Also the users in iPlanet are generally created under "ou=people" and not "cn=users". try changing ur filter as(uniquemember=CN=SundanceGroup,ou=people,DC=Test,DC=com).
    BTW
    does anyone know how to query different servers with a common filter to get the groups of a user.

  • Mysql query not getting all the results, works fine in php

    Hi All,
    I have a slightly big query which works fine in php getting 400 results but in java I get only 14 results when I traverse through resultset. Here is the query
    (select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 left outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t2.sip_method='BYE' where t1.sip_method='INVITE' and (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1' ) union (select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 right outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t1.sip_method='INVITE' where t2.sip_method='BYE' and isnull(t1.username) and (t2.username='manoj' and t2.domain='mantragroup.com') and t2.callee_deleted != '1' ) order by ttime DESC limit 100,50
    Also this queru works fine on mysql console getting all 400 results. Please tell me what might be going wrong in Java.
    Thanks for your help and time,
    Manoj.

    How do you know you're doing the same query in PHP, MySQL, and the console?
    What's the code that's executing this?
    There's nothing intrinsically wrong with the query, although it's a bit messy - surely it could be simplified from that?
    Please format queries before posting in future. Also, did you really mean to let us know your company name and the name of a user? Seems a bit indiscrete.
         select
            t1.to_uri as inv_to_uri,
            t1.sip_to as inv_sip_to,
            t1.sip_callid as inv_callid,
            t1.time as inv_time,
            t1.fromtag as inv_fromtag,
            t1.sip_status as inv_status,
            t2.to_uri as bye_to_uri,
            t2.sip_to as bye_sip_to,
            t2.sip_callid as bye_callid,
            t2.time as bye_time,
            t2.fromtag as bye_fromtag,
            t2.totag as bye_totag,
            t2.from_uri as bye_from_uri,
            t2.sip_from as bye_sip_from,
            sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
            ifnull(t1.time, t2.time) as ttime ,
            'outgoing' as call_type
         from
            acc t1
         left outer join
            acc t2
         on
            t1.sip_callid=t2.sip_callid
         and
            (  (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
            or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
         and
            t2.sip_method='BYE'
         where
            t1.sip_method='INVITE'
         and
            (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1'
    union
         select
            t1.to_uri as inv_to_uri,
            t1.sip_to as inv_sip_to,
            t1.sip_callid as inv_callid,
            t1.time as inv_time,
            t1.fromtag as inv_fromtag,
            t1.sip_status as inv_status,
            t2.to_uri as bye_to_uri,
            t2.sip_to as bye_sip_to,
            t2.sip_callid as bye_callid,
            t2.time as bye_time,
            t2.fromtag as bye_fromtag,
            t2.totag as bye_totag,
            t2.from_uri as bye_from_uri,
            t2.sip_from as bye_sip_from,
            sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
            ifnull(t1.time, t2.time) as ttime ,
            'outgoing' as call_type
         from
            acc t1
         right outer join
            acc t2
         on
            t1.sip_callid=t2.sip_callid
         and
            (  (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
            or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
         and
            t1.sip_method='INVITE'
         where
            t2.sip_method='BYE'
         and
            isnull(t1.username)
         and
            (t2.username='manoj' and t2.domain='mantragroup.com')
         and
            t2.callee_deleted != '1'
    order by ttime DESC limit 100,50

  • Query to get all the data in specific range

    Dear All,
    I have a table and having 50 records. So i want to fetch the records from specified range.
    Ex:
    1. I want to fetch the records from first 1 to 10 records ( range i will pass) or i want to fetch from 20 to 30 records.
    Please help regarding that

    YKING wrote:
    Dear Thanks for replying,
    i want to display the first 10 records/display the between 20 to 30 range records (from 20 th records to 30 th records). I m using below query one is working but another is not working. pelase advise what wrong with one which is not working
    Not working :-
    select rownum , b.*
    from
    (select rownum, a.* from table_name a
    order by colum1) b
    where rownum between &a and &b
    working :-
    select *
    from (select rownum rn, a.*
    from table_name a
    order by vesl_master_num)
    where rn between &s and &q;What's wrong with the one that is not working ... ok...
    You are using "rownum" which is a psuedo column assigned to the returned rows. So if row 1 is not returned then there will never be a rows 2, 3, 4 etc. so you can't say you want e.g. rownum between 10 and 20 because rows 1 to 9 haven't been returned, so there's no such things as a row 10,11,12 etc.
    In the query that's working you've kind of captured the rownum for all the rows and then you can restrict it. However, the ordering of the data still isn't right in that last example, because the ordering takes place after the rownum is assigned.
    So what you really want is...
    select *
    from (select rownum rn, a.*
           from table_name a 
          order by vesl_master_num)
    where rn between &s and &q;which applies the ordering first, then applies the row numbers outside that, and then restricts to certain row numbers outside that.

  • Extend existing tsql query to get all customers, even if they have no instances of the previous query - thought this would be easy, but...

    Hi all,
    The previous query is absolutely ok.
    The only thing i want to change is ...
    get all the previous available ve1 AND NEW: if a AGNR has no ve1-instance, regardless get an ve1-instance with the agnr filled but f.e. the other fields empty
    The grouping could made in reporting-logic later, and not in the tsql-query.
    resultset i need:
    - all agnr, if the have an ve1-instance or not
    Groups (hierarchy) i need, later in Report:
    - AGNR
       - ve1 (with all the left joind fields pg, vnfk, vnpk, vm (if they are)
       - if a agnr has no instance of ve1 --> print: "NO ver available"
    SELECT
    ve1.new_verid,
    ve1.new_no,
    ve1.statuscode,
    ve1.statuscodename,
    ve1.createdon,
    ve1.createdby,
    ve1.createdbyname,
    ve1.new_begin,
    DATEPART(yyyy, ve1.new_begin) AS begin_year,
    ve1.new_end,
    ve1.new_vn_fid,
    ve1.new_vn_fidname,
    ve1.new_vn_kid,
    ve1.new_vn_kidname,
    vnpk.new_how_old,
    ve1.new_vg,
    ve1.new_vgname,
    ve1.new_vs,
    ve1.new_vsname,
    ve1.new_vstat,
    ve1.new_vstatname,
    ve1.new_zw,
    ve1.new_zwname,
    ve1.new_bn_zw,
    ve1.new_rlz_v,
    ve1.new_pgid,
    ve1.new_pgidname,
    pg.accountnumber as pg_accountno,
    ve1.new_agnr_agnr_avmid,
    ve1.new_agnr_agnr_avmidname,
    AGNR.new_vm_kid AS vm_contactid,
    AGNR.new_vm_kidname AS vm_contactidname,
    ve1.new_efv,
    ve1.new_efvname,
    CASE
    WHEN ve1.new_vn_kid IS NOT NULL THEN 'Private Customer'
    WHEN ve1.new_vn_fid IS NOT NULL THEN 'Account Customer'
    ELSE 'Kunde'
    END AS kunde_typ,
    DATEPART(yyyy, vnpk.birthdate) as vnpk_birth_year,
    CASE
    WHEN ((ve1.new_rlz_v IS NOT NULL) OR (ve1.new_rlz_v > 0))
    THEN ve1.new_rlz_v
    WHEN (DATEPART(yyyy, ve1.new_begin) IS NOT NULL) AND (DATEPART(yyyy, vnpk.birthdate) IS NOT NULL)
    THEN 65 - ((DATEPART(yyyy, ve1.new_begin)) - (DATEPART(yyyy, vnpk.birthdate)))
    ELSE 20
    END AS vlz_calc,
    CASE
    WHEN ((ve1.new_bnj IS NOT NULL) OR (ve1.new_bnj > 0)) THEN ve1.new_bnj
    WHEN ((ve1.new_bn_zw IS NOT NULL) OR (ve1.new_bn_zw > 0))
    THEN
    CASE
    WHEN new_zw = '100000008' THEN ve1.new_bn_zw * 12
    WHEN new_zw = '100000004' THEN ve1.new_bn_zw * 4
    WHEN new_zw = '100000002' THEN ve1.new_bn_zw * 2
    WHEN new_zw = '100000001' THEN ve1.new_bn_zw * 1
    WHEN new_zw = '100000006' THEN ve1.new_bn_zw
    ELSE 0
    END
    ELSE 0
    END AS bnj_calc
    FROM
    Filterednew_ver AS ve1
    LEFT OUTER JOIN Filterednew_agnr AS AGNR
    ON ve1.new_agnr_agnr_avmid = AGNR.new_agnrid
    LEFT OUTER JOIN FilteredAccount AS pg
    ON ve1.new_pgid = pg.accountid
    LEFT OUTER JOIN FilteredAccount AS vnfk
    ON ve1.new_vn_fid = vnfk.accountid
    LEFT OUTER JOIN FilteredContact AS vnpk
    ON ve1.new_vn_kid = vnpk.contactid
    LEFT OUTER JOIN FilteredContact AS vm
    ON AGNR.new_vm_kid = vm.contactid
    WHERE
    (ve1.createdon >= @Begin_Week)
    AND (ve1.createdon <= @End_Week)
    AND (ve1.new_vg = @vg)
    AND (ve1.statuscode = '1')
    AND (ve1.new_efv <> '100000000' OR ve1.new_efv IS NULL)
    AND (ve1.new_vstat <> '100000004' OR ve1.new_vstat IS NULL)
    AND (ve1.new_zw IN ('100000008','100000004','100000002','100000001','100000006'))
    ORDER BY
    ve1.createdon
    i thought, and tried with right joins, but i think i need to change the sight (the complete query)?
    thx for all kind of help
    Greets Peb

    Hi Peb,
    Please provide sample data and expected results.

  • Query to get all the worksheets for a particular work book

    Hi All,
    I want to get all the associated worksheets for a particular workbook. What query will fetch mne those details. Also, where can find the EUL5 tables documentation
    Regards
    Thomas

    Hi Tamir,
    Thanks so far. I am yet to make the crucial breakthrough as far my application goes. Are you talking about the EUL5_QPP_STATS table? I tried retrieving worksheets even from that table also with the following query
    SELECT DISTINCT Eul5QppStats.QS_DOC_NAME,Eul5QppStats.QS_DOC_DETAILS
    FROM EUL5_QPP_STATS Eul5QppStats,EUL5_DOCUMENTS Eul5Documents
    WHERE Eul5QppStats.QS_DOC_NAME = Eul5Documents.DOC_NAME
    However, the worksheet data retrieved by Discoverer Oracle's product is not matching my dataset for every workbook. Please suggest.
    Reg
    Thomas

  • Determining if a user is disabled in OD using LDAP query

    Hello all,
    I'm doing a LDAP query against my OD to make a web-based user directory. I'm using PHP and doing a LDAP search against 10.6 Server OD such as this:
    $sr=ldap_search($ds, "cn=users,dc=my_server,dc=private", "(CN=*)");
    The search is working perfectly, and I'm getting an array result with multiple key/values such as:
    objectclass
    uidnumber
    apple-generateduid
    apple-mcxflags
    loginshell
    etc.......
    Since it's a listing of active employees, I want to identify deactivated ones and filter them out of my listing. However, I can't see any key/values that could tell me if a user is deactivated or not.
    What would be the best way? Must I run a command line to see if a user is disabled, and if so, what command? (However, this would be poor on performance...)
    Thanks.

    I looked into this ages ago here:
    https://discussions.apple.com/message/6595575#6595575
    This information was relevant back in 10.4 which was post NetInfo.  All things being equal, this is likely still the case.  However, this may have changed and I apologize in advance for not validating.

  • A query to get all sales processed in 2007 ?

    Hi All,
    I got a requirement from user saying
    " We have situations where "new" sales get processed against already existing or "old" sales orders. I need a query which shows all sales processed in year 2007 by sales order or whatever other identifier that is used"
    This is not making any sense to me. Can anyone help me with this ? Is there something to do with ship date or anything? Please let me know!!
    Thanks in advance
    Prathibha

    Hi Prathibha,
    The only idea that came to my mind is the following: your customer sends order in a regular interval (weekly, monthly…) under a number that represents an agreement between you and your customer.
    Under this scenario, you have one order created in the previous period from customer A that was partially shipped. In the current period, customer A sends a new order to you, but the quantity sent by your customer includes the balance. So, if new_quantity greater than old order balance, you will need to add an order with the balance.
    Still under this scenario, the report could all orders in OM posted/shipped in 2007 under this agreement.
    Just an idea, hope it helps,
    Ketter Ohnes

Maybe you are looking for