Script to find OU name and object name in AD

Hi , can any one help me on this, I need a script to find OU name along with object name in entire domain.
Regards, Triyambak

Hi Triyambak,
As DexterPOSH mentioned, Get-ADObject can be used here.
To list all OUs and the relevant objects of each OU in domain, please try the script below:
Import-Module ActiveDirectory
Get-ADOrganizationalUnit -Filter *|foreach{
Get-ADObject -SearchBase $_.DistinguishedName -Filter *}
If you have any feedback on our support, please click here.
Best Regards,
Anna
TechNet Community Support

Similar Messages

  • Script to find out table and index candidates to keep in the buffer pool

    I am looking for a script to find out tables and indexes to keep in the buffer pool.
    Could you help me on this ?
    thanks...
    Markus

    this is more of a open question. As you know ur data well. We do not know whats ur data. cachin tables in buffer pool is okay, but it might age out after not being used...instead you can use the KEEP POOL...to cache small tables/popular tables into the keep pool...as keep pool guarantees full caching .....
    here are some links on keep pool cacheing
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#sthref410
    http://www.dba-oracle.com/oracle_tips_cache_small_fts.htm
    http://www.dba-oracle.com/t_script_automate_keep_pool_tables_indexes.htm
    http://www.dba-oracle.com/oracle_news/news_caching_keep_pool_large_objects_clob_blob.htm
    Edited by: user630084 on Apr 8, 2009 5:48 AM

  • Script to find duplicate index and how can we tell if an index is REALLY a duplicate?

    Does any one have script to find duplicate index? and how can we tell if an index is REALLY a duplicate?
    Rahul

    One more written by Itzik Ben-Gan
    The first query finds exact matches. The indexes must have 
    the same key columns in the same order, and the same included columns but in any order. 
    These indexes are sure targets for elimination. The only caution would be to check for index hints. 
    -- exact duplicates
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols,
    (select case keyno when 0 then colid else NULL end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by colid
    for xml path('')) as inc
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'exactduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and c1.cols = c2.cols
    and c1.inc = c2.inc;
    The second variation of this query finds partial, or duplicate, indexes 
    that share leading key columns, e.g. Ix1(col1, col2, col3) and Ix2(col1, col2) 
    would be considered duplicate indexes. This query only examines key columns and does not consider included columns. 
    These types of indexes are probable dead indexes walking. 
    -- Overlapping indxes
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'partialduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and (c1.cols like c2.cols + '%' 
    or c2.cols like c1.cols + '%') ;
    Be careful when dropping a partial duplicate index if the two indexes differ greatly in width. 
    For example, if Ix1 is a very wide index with 12 columns, and Ix2 is a narrow two-column index 
    that shares the first two columns, you may want to leave Ix2 as a faster, tighter, narrower index.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Script to find a user and restart two services

    I am looking to make a script to first find a user that is connected to a server (list) the to stop Spooler, then stop cpsvc. Once the services are stopped, the script would then clear out the folder on "C:\Windows\System32\spool\PRINTERS"
    Directory. Once that was done, the script would then start Spooler and cpsvc. At the end it would echo the services were restarted and to try to print now.
    Lee Mossolle

    A user cannot stop and start services and cannot delete files in the system folders.
    There is no need to look for the services in that way  You will have to do this remotely.  Just find the services if they exisit and stop them then remotely delete the contents of the spooler folder.
    PowerShell remoting would be the easies way to do this.
    strComputer = WScript.Arguments(0)
    WScript.Echo "Running Against Remote Computer Named: " & strComputer
    set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name = 'cpsvc' OR Name = 'spooler'")
    for Each objService in colListOfServices
    objService.StopService()
    objService.StartService()
    Next
    Until you understand how yor code will work avoid over coding.  It just adds confusion and errors.   The above is functionally equivalent to what you posted. 
    I suspect there may be a dependency between cpsvc and spooler.  In that casr yo can only kill them in the correct order.  This will require to loops of a more sophisticated scripting approach.
    We can also use the 'Forse' argument and retriev the master service (spooler) and force it to stop all dependent services.  We would then retrive all services and start them. We can also just retrieve the dependency list and use that.
    The code is simple and will allow the dependencies to be added if needed.
    You can also use PowerShell which is much easier.
    Get-Service spooler -computer remotepc | Stop-Service -force
    Get-Service spooler -computer remotepc | Start-Service
    We can wrap this in a function for convenience.
    ¯\_(ツ)_/¯

  • Find Universe, classes and objects used in each report

    I want to find a list of universes, classes and objects used in each report
    or the other way to find list of reports which use a particular universe. please let know, i could not get much information from activity universe in a proper way.

    Hello Venkataramat,
    plese post in more detail what kind of report you are using Crystal report ? webi ? Deski.
    Please post in the specific forums.
    If you have a Crystal Report I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    Best regards
    Falk

  • Looking for Pages script to find "return" "return" and delete 2nd one only

    Looking for a Pages Applescript to find "return" "return" and delete 2nd one only. Perform on entire document.
    Thanks

    Funny, the same question was asked on 2011/11/12 in http://macscripter.net/viewtopic.php?id=37477
    Nigel Garvey posted a neat answer :
    --{code}
    tell application "Pages"
       delete (paragraphs of front document whose length is 1)
    end tell
    --{code}
    Yvan KOENIG (VALLAURIS, France)  lundi 14 janvier 2011 11:01:29
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Script to find the service and manage its state

    We have a service that runs with different names on different machines like
    Bomgar-scadsadccd, Bomgarsdscchfn, Bomgarscnkfkdk
    So, here we need to write a VB script that will find this service with partial name "Bomgar" and check it's status like
    1) Not present, then should install from a shared folder like "start \10.216.16.245\Bomgar.exe"
    2) Installed but not running, then start the service.
    3) Installed and running then quit.
    How can we achieve this? This is what i have tried..
    "strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service
    where Name='bomgar*'")
    nItems = colRunningServices.Count
        If nItems > 0  Then
    For Each objItem in colRunningServices
        If objItem.State = "Stopped" Then objItem.startservice            
                ElseIf objItem.State = "Running" Then exit
    End If
        Next
    Else
            start \\10.18.23.245\Shared\Bomgar.exe
    End If

    We have a service that runs with different names on different machines like
    Bomgar-scadsadccd, Bomgarsdscchfn, Bomgarscnkfkdk
    So, here we need to write a VB script that will find this service with partial name "Bomgar" and check it's status.
    Instead of re-inventing the wheel with a script you could these existing console commands:
    net  start  |  find  /i  "Bomgar"
    (to find out which Bomgar services exist)
    sc  query "Bomgar-scadsadccd"
    (to check the status of this service)
    net start "Bomgar-scadsadccd"
    (to start the service)

  • How to find crm tables and objects in service market place?

    hi
    there is a place or link in www.service.sap.com where we get the information about the objects/tables related to  business partners,products,sales,service and marketing.
    can anyone please provide me that link,information.
    regards,
    hun

    Hello Hun,
    Check out this link,
    Links to CRM Documentation
    May be that was the thread u were searching for...
    Also some of the tables in my knowledge are as follows,
    1. COMM_PRODUCT: Product header and administration data.
    2. CRMC_T077D: customer account groups
    3. CRMD_ORDERADM_I (Item data)
    CRMD_ORDERADM_H: Business Transactions header CRM
    4.CRMD_ACTIVITY_H: Activity
    5.CRMD_OPPORT_H :Opportunity
    6.BUTOO : Customer details
    7.BUT001:BP General data II
    8.BUT100: BP Roles
    9.BUT150: BP relationship: Attribute table (test different
    10.BUT_HIER_TREE Business Partner Group Hierarchy
    11.CDBC_T_PRODUCTID Mapping: Product Id
    12.CDBD_ORGMAN Business transaction - organizational unit - set
    13.COMC_PRODUCT General Product Settings
    14.COMC_R3_FIELDS Assignment of R/3 material master fields to CFOP
    15.COMM_CATEGORY Category
    16.COMM_CFGMAT Basic Data for Materials
    17.COMM_HIERARCHY Category Hierarchy
    18.COMP_TYPES Hierarchy Tool: Comparison Type Check Table
    19.CRMC_CPRICPROC Customer Pricing Procedures
    20.SMOKVBEZ15 Assignment employees to positions
    ==========================================================
    R/3 Tables re CRM:
    1. CRMRFCPAR: CRM Destination.
    2. CRMPRLS: Name of the Logical System for Download(GUID).
    3. CRMCONSUM: Consumer entry (must match consumer of object in R3AC*).
    4. KNA1: Business Partner Master Data.
    5. CRMPARNR: Partner Functions \ Contacts
    6. CRMKUNNR: Business Partner GUIDS
    7. KNVV: Sales Area Data
    8. KNVP: Sales Area Data
    9. KNVK: Contact Person
    10. TBE31 & 34: Events/Enhancement
    11.MARA: Products
    12. CRMFILTAB: Filters
    13. CRMBP_MAP_BUGRP: Mapping of Business Partner Grouping
    14. CRMCLASSIF: Account Groups in Replication into R/3
    15. CRMCONSUM Possible Users R/3 Adapter Functionality
    16.CRMFILFLD Permitted Table Fields for Filtering
    17.CRMFILTAB Filter Criteria for Download
    18.CRMINTBAP Assignment of Internal& External Table FLD
    19.CRMKTOKD Assign Classification and Grouping R/3 Account Groups
    20.CRMKUNNR Mapping Table Business Partner - Customer
    21.CRMMAPTAB: Relationship Between Table Names in CRMOBJTAB (Tables Belonging to One Object) and BAPIMTCS is Middleware Transaction Container Structure
    22.CRMPARNR Mapping Table Business Partner Relationship - Contact Person
    23.CRMPAROLTP CRM OLTP Parameter
    24.CRMQNAMES Queue Name Management for CRM-QRFC Supply
    25.CRMSUBTAB Subscription Table for Up and Download Objects
    26.COM_BUPA_CALL_FU Determining FMs for Data Exchange BP
    27.COM_BUPA_BCSET Central Settings Data Exchange Business Partner
    28.TCRMBP_REFCUST Default Reference Customer
    =========================================================
    CRM Tables:
    1.CRMMLSGUID: GUID entry (should match GUID in CRMPRLS) also its LOGSYS-change-LOG.
    2. CRMM_BUT_CUSTNO: Also GUID table (GUID here should match GUID in R/3 table CRMKUNNR)
    3.SMOFSUBTAB: Mapping & Parameters
    4.SMOFDSTAT: Download Monitor (R4AM1)
    5.SMOFFILTAB: Filters (Should match filters in R3AC1 & R/3 Table CRMFILTAB)
    6.SMOFOBJECT Definition of Objects for Download
    7.SMOFOBJPAR Parent Objects of an Object in Table
    8.SMOFPARSFA Middleware Parameter
    9.SMOFQFIND Queue Finder Table for MW-Queue finder
    10.SMOFTABLES Definition of Tables for Download.
    11. CRM_JEST: Individual Object Status
    12. CRMD_SHIPPING: Business Transaction - Shipping Set
    13. COMM_PRODUCT: Product
    14. CRMD_ORDERADM_H: Business Transaction
    15. COM_TA_R3_ID: R3 Identification
    16. SCAPPTSEG: Folder for Individual Appointments
    17. CRMD_PARTNER: Partners
    18. CRMD_CUSTOMER_H: Transaction - Customer Extension
    ===========================================================
    KindlyReward Graciously if found useful...:)
    Regards,
    Harish

  • Script to find the " List of objects to be pinned in the shared pool"

    hi all,
    please suggest me any script is there to find the recommended objects to be pinned in to shared pool.
    Regards,
    Vamsi.

    I think the important question here is – do you really need to PIN objects? Are you facing any ORA-4031 errors?
    Oracle would tell you to PIN packages such as STANDARD, DBMS_STANDARD, DBMS_UTILITY, DBMS_OUTPUT. It really depends on your application. So I am afraid there is no exact answer for that, but you can work with your application team to learn if there is some large object that is very frequently used that you might want to PIN.
    I suggest that you check the larger objects from your SGA using the view v$db_object_cache that folks already pointed out checking the column SHARABLE_MEM.
    You can refer to v$sql or v$sqlarea (which is a grouping of v$sql) to find the most executed stored procedures and packages and so on.
    However, most of the problems shared pool problems I have faced were related to bad application coding - such as lack of bind variables - or shared pool undersized. Once those problems were fixed, I hardly had to PIN anything into the SGA.
    Regards

  • EEM script to find a pattern and send an alert of some sort

    Hello folks, can someone suggest why the script below is not returning anything?
    My goal is to execute 'show hsrp detail', if HSRP output contains pattern indicated below, I should be able to generate an alert somehow.
    Please let me know what I am missing.
    event manager applet HSRP
      event syslog pattern "Standby router is unknown"
      action 1.0 cli show hsrp detail
      action 2.0 syslog msg HSRP ISSUE  
      action 3.0 cli end
    This is the output I want to find pattern from:
    SWITCHTEST# show hsrp detail
    Ethernet2/1 - Group 101 (HSRP-V2) (IPv4)
      Local state is Initial(Interface Down), priority 90 (Cfged 90), may preempt
        Forwarding threshold(for vPC), lower: 1 upper: 90
      Hellotime 3 sec, holdtime 10 sec
      Virtual IP address is 10.17.173.1 (Cfged)
      Active router is unknown
      Standby router is unknown
      Authentication text "cisco"
      Virtual mac address is 0000.0c9f.f065 (Default MAC)
      6 state changes, last state change 04:18:02
      IP redundancy name is hsrp-Eth2/1-101 (default)

    What you want to do is not possible on NX-OS yet.  While you can get the syslog message "HSRP ISSUE" the output of the command will not display.  You could store it on flash by redirecting the output to a local file, but it will not appear in the syslog message.

  • Script to find specific font and copy to a new document

    I am working on a scripting solution to help break out files for production. What I need to do is search through a PSD, find any text objects that are in a specific font, and if they match, copy them to a new document. Can anyone help me with this? I've been able to make parts work, but I am very green, and could use a little bit of direction.
    thanks!

    Yeah so far I've been having trouble checking the layers, identifying the fonts, and the creating the new text object on a new file So pretty much the whole thing is broken at the moment.  Any help you could offer would be greatly appreciated. I'm just now really starting to learn javascript just to be able to automate photoshop.

  • Find all system and object privs granted to a user

    I need a query to find out all sys and ibject qyery given to a user. This is because a user was able to query all_directories few days ago in production instance, now he is unable to do it.
    I found a query to find all roles inside a role. This role "APPS_QUERY_ROLE" has another 25 roles inside it. I want a query which will drill down to each role and "role within a role" to find all privileges associated to a role and hence to the user.

    This may be helpful to you :
    SYS@orcl> select 'create role ' || role || ';'
      2  from dba_roles
      3  where role = '&&role';
    Enter value for role: APPS_QUERY_ROLE      <------Make sure it should be in CAPS
    old   3: where role = '&&role'
    new   3: where role = 'APPS_QUERY_ROLE'
    no rows selected
    SYS@orcl> select 'grant ' || privilege || ' to &&role' ||
      2  decode(admin_option,'YES',' with admin option;','NO',';')
      3  from role_sys_privs
      4  where role = '&&role';
    old   1: select 'grant ' || privilege || ' to &&role' ||
    new   1: select 'grant ' || privilege || ' to APPS_QUERY_ROLE' ||
    old   4: where role = '&&role'
    new   4: where role = 'APPS_QUERY_ROLE'
    no rows selected
    SYS@orcl> select 'grant ' || privilege || ' on ' || owner || '.' || table_name
      2  || ' to &&role ' || decode(grantable,'YES','with grant option;','NO',';')
      3  from role_tab_privs
      4  where role = '&&role';
    old   2: || ' to &&role ' || decode(grantable,'YES','with grant option;','NO',';')
    new   2: || ' to APPS_QUERY_ROLE ' || decode(grantable,'YES','with grant option;','NO',';')
    old   4: where role = '&&role'
    new   4: where role = 'APPS_QUERY_ROLE'
    no rows selected
    SYS@orcl>Source:Re: Help to Generate Role Creation Script
    Regards
    Girish Sharma

  • Where can I find little arrows and objects to display using an alerter?

    I need a little arrow to turn red or green depending on a value.  I can make the alerter work but not find a convenient way to put the find little arrow to put in the cell to display.

    Hi Roguefem,
    You need to have images stored in boimg directory (normally C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\images).
    You can put it in image from url section on the format section. So for an up and down image your will need 2 separate images.
    Regards
    Alan

  • Find Backup Size And Backup Window

    Hi Guys,
    Can any one give script to find backup size and backup window (total time taken to conduct backup).
    I am using Oracle 10gR2 on sun solaris 5.8
    Backup-RMAN Full backup every day.
    Regards

    Hi,
    backup size
    what do you mean by backup size .. ??
    User show all to list out the configuration details;
    Thanks
    Pavan Kumar N
    Message was edited by:
    Pavan Kumar

  • A Script to Find and Replace Layer Names

    Are there any scripts to find and replace layer names?
    There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers.
    The illustrator version of this script only allows sequential numbering: It doesn't offer find and replacing of words.
    Ideally, it would be great if there was something that could do multiple find and replaces in one go:
    (e.g.
    You have layers like this Car, Dog, Bat
    You enter: car(Option1), dog(Option2), Bat(Option3)
    Your layers then become: Option1, Option2, Option3).

    big_smile, that's a very good start! Step 1 of Learning How To Script is indeed, adjusting an existing simple script to make it do more complicated things. (And usually then "break something", which is also a required part of the process.)
    You are correct in your observation this is repetitive stuff. For one or two different items that wouldn't be a problem, but in longer lists you soon get lost.
    The usual way of working with find-change lists is to build an array:
    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    The general idea is to loop over all names, check if the current layer name is "layernames[i][0]" (the left column) and if so, rename it to "layernames[i][1]" (the right column). If you know how to write a loop in Javascript, then you can implement this right away.
    However ..
    A more advanced way to do this doesn't even need loop to over all layernames -- instead you can immediately "get" the correct name per layer! It's magic! Almost!
    The trick is to use a Javascript object instead of an array. Javascript objects are nothing special; Illustrator's 'layers' is an array of objects, and each object "layer" has a property "name", whose value you can read and set. What I do here is create a new object, where the "name" part is the original layer name and its value is the new layer name. All you need to check for per each layer is if there is a property 'object.originalLayerName', and if so, assign its value to that layer name.
    This looks a bit like the array above, except that (1) you use {..} instead of [..] to create an object, and (2) you add "name:value" pairs instead of "value" only (actually, the 'name' of a value in an array is simply its number).
    So this is what it looks like:
    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
    'FHairBowlBoy *Hair':'Hairboy1',
    'FHairCurlyafroBoy *Hair':'Hairboy2',
    'FHairSpikyBoy *Hair':'Hairboy3'
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    //Set up Variable to access layer name
    var currentLayer = app.activeDocument.layers[i];
    if (layernames[currentLayer.name])
      currentLayer.name = layernames[currentLayer.name];
    Enjoy!

Maybe you are looking for