Create AD OU structure
Hi
Does anyone has a vbscript to create AD OU structure from text file.
Regards Sushain KApoor
A script to create an OU structure based on a file containing tab separated values (TSV). This script discovers the domain name based on the user account running the script and is limited to a three level OU structure.
Example input file (save as OUStructure.txt in the script location):
Root Root Finance Finance Objects
Root Finance Users Finance Users
Root Finance Laptops Finance Laptops
Root Finance Desktops Finance Desktops
Root Finance Printers Finance Printers
Root Root Marketing Marketing Objects
Root Marketing Users Marketing Users
Root Marketing Laptops Marketing Laptops
Root Marketing Desktops Marketing Desktops
Root Marketing Printers Marketing Printers
Root Root Administrators Administrators Objects
Root Administrators Users Administrators Users
Root Administrators Laptops Administrators Dektops
Root Administrators Desktops Administrators Desktops
Note: If copying the text above ensure that tab is used instead of multiple spaces
strInputFile = "OUStructure.txt"
set objFSO = Wscript.CreateObject("scripting.filesystemobject")
Set objInputFile = objFSO.OpenTextFile(strInputFile, 1)
Set objNetwork = WScript.CreateObject("WScript.Network")
strDomain = objNetwork.UserDomain
strRoot = "DC=" & strDomain & ",DC=local"
Do Until objInputFile.AtEndOfStream
strLine = objInputFile.readline
strLine = replace(strLine,chr(34),"")
strLine = replace(strLine,",",chr(92) & ",")
arrLine = split(strLine,vbTab)
If (arrLine(1) = "Root") then
strLDAP = "LDAP://" & strRoot
set objLDAP = getobject(strLDAP)
set objOU = objLDAP.create("organizationalUnit","OU=" & arrLine(2))
objOU.Put "Description", arrLine(3)
objOU.Setinfo
Else If (arrLine(0) = "Root") then
strLDAP = "LDAP://OU=" & arrLine (1) & "," & strRoot
set objLDAP = getobject(strLDAP)
set objOU = objLDAP.create("organizationalUnit","OU=" & arrLine(2))
objOU.Put "Description", arrLine(3)
objOU.Setinfo
Else
strLDAP = "LDAP://OU=" & arrLine(1) & ",OU=" & arrLine(0) & "," & strRoot
set objLDAP = getobject(strLDAP)
set objOU = objLDAP.create("organizationalUnit","OU=" & arrLine(2))
objOU.Put "Description", arrLine(3)
objOU.Setinfo
End If
End If
Loop
wscript.echo "Complete"
Similar Messages
-
How to create a tree structure using forms.
Hi,
How do i create a tree structure using oracle forms,i have a table named Functions and a specific column 'Function Name' should be displayed in the tree nodes.Can anyone help me out on how to create a tree structure and populating the nodes??
thanks in advance
Regards
KarthikThe FTree package provides functions to populate the tree - look for the topic "Manipulating a hierarchical tree at runtime
" in the online help this point to all the functions and triggers -
How can I create a Tree Structure in java ??
Hi,
I want to create a tree structure(objects hierarchy) using java language. Is there any API method for this ?
Can any one please give me a hint or suggestion how I can do this ??
Thanks for the help in advance.Do you mean graphically?
You can use a TreeSet or TreeMap if you just want to use tree structures.
Kaj -
Create a deep structure for dynamic internal table
Hi All,
I am creating a dynamic table using method cl_alv_table_create=>create_dynamic_table.
The normal structure gets created. but now I want to creat a Deep structure for having information of colors also for each column. So I want to add a COLTAB type LVC_T_SCOL for colors information .
How should I create this using above method?
Rgds,
MadhuriI created a zcelltab structure as below. But while creating dynamic internal table, I received the error with
'Type "ZCELLTAB" is unknown 68 ZCELLTAB-CELLTAB
Here is the code.
DATA: BEGIN OF ZCELLTAB,
CELLTAB LIKE LVC_S_STYL,
END OF ZCELLTAB.
FIELD-SYMBOLS <T_CELLTAB> TYPE LVC_T_STYL.
DATA : LT_CELLTAB TYPE LVC_T_STYL.
DATA: WA_CELLTAB TYPE LINE OF LVC_T_STYL.
DATA: GT_FCAT1 TYPE LVC_T_FCAT,
GW_FCAT1 TYPE LVC_S_FCAT,
GT_FCAT2 TYPE LVC_T_FCAT,
GW_FCAT2 TYPE LVC_S_FCAT.
After filling the FCAT1, I added the field in FCAT2 like below
GT_FCAT2[ ] = GT_FCAT1[ ].
G_TABIX = G_TABIX + 1.
GW_FCAT2-INTTYPE = 'C'.
MOVE G_TABIX TO GW_FCAT2-COL_POS.
GW_FCAT2-OUTPUTLEN = '10'.
GW_FCAT2-FIELDNAME = 'T_CELLTAB'.
GW_FCAT2-TABNAME = 'ZCELLTAB'.
GW_FCAT2-REF_FIELD = 'CELLTAB'.
GW_FCAT2-REF_TABLE = 'ZCELLTAB'.
APPEND GW_FCAT2 TO GT_FCAT2
CLEAR GW_FCAT2.
While calling the below method, the error with
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = GT_FCAT2
IMPORTING
EP_TABLE = GT_REQ.
ASSIGN GT_REQ->* TO <F_TAB>.
CREATE DATA GWA_REQ LIKE LINE OF <F_TAB>.
ASSIGN GWA_REQ->* TO <F_WA>.
LOOP AT ITAB.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE <F_WA> TO <F_VAL>
<F_VAL> = ITAB-MATNR.
IF ITAB-MATNR IS INITIAL.
ASSIGN COMPONENT 'T_CELLTAB' OF STRUCTURE <F_WA> TO <T_CELLTAB>
CLEAR WA_CELLTAB.
WA_CELLTAB-FIELDNAME = 'MATNR'.
WA_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
INSERT WA_CELLTAB INTO TABLE <T_CELLTAB>.
ENDIF.
APPEND <F_WA> TO <F_TAB>
ENDLOOP.
CALL METHOD GR_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_CONSISTENCY_CHECK = G_CONSISTENCY_CHECK
IT_TOOLBAR_EXCLUDING = G_EXCLUDE
I_SAVE = G_SAVE
I_DEFAULT = 'X'
IS_LAYOUT = G_LAYOUT
CHANGING
IT_OUTTAB = <F_TAB>
IT_FIELDCATALOG = F_CAT1.
Please let me know where I was wrong.
Should I remove the T_CELLTAB as the field name is not mentioned in the structure 'ZCELLTAB'.
Thanks,
Kumar.
Edited by: venn e on May 7, 2010 4:10 PM -
Is it possible to create a menu structure within iWeb with a so called tree layout? iWeb only provides automatically a horizontal layout
Not in iWeb itself.
You have to create these menus yourself. Start here :
A List Apart: Articles: Suckerfish Dropdowns
Also, see podcast episode 9 of
CSS Tricks and Tips
and then add them to a webpage with the HTML Snippet.
Or add the menu to the webpage with a JavaScript.
Here's a sample page :
http://www.wyodor.net/mfi/roodhout/
http://www.wyodor.net/mfi/spelling/
http://www.wyodor.net/mfi/Maaskant/Some_Menus.html
The how-to-do page are here and here.
More sample pages on my Made for iPad with iWeb pages.
http://www.wyodor.net/mfi/
You may have to learn HTML, CSS, JavaScript, AJAX, DOM and how iWeb creates its pages. -
Error while creating the Organization structure.
Hi,
I am trying to create an Organization structure in SRM 5 sytem, I have created a Root for the structure and when i try to click on the Attribute Inheritance or the Check tab below i am getting an error "Start program BBP_LOCATIONS_GET_ALL first (see note 563180 and long text)" but i have replicated one plant from the R/3 system using BBP_LOCATIONS_GET_SELECTED and the material groups and all the other relevant datas from R/3. I can see in the table BBP_LOCMAP the plant been associated with the relevant company code. I am now struck in creating the organization structure. I am not sure where i am going wrong while creating the Org model.Please give me your valuable inputs to overcome this error.
Regards
GGLGo to transaction SM30, table T77S0
Add an X to the following entry:
Group = EBP
Sem abbr. = LMIGR
Val. Abbr. = X
Description = Locations Successfully Migrated
This tell the system that the locations have been replicated and the error indicating location get all needs be executed will go away.
thanks,
justin
Edited by: Justin Farley on Feb 25, 2009 7:16 PM -
Getting error while creating a infotype structure
Hi Freinds,
after creating info type structure, when i am tryng to save ( hitting on local object) , the folloeing error is coming ? how to solve this error ?
Package in non-original system only modifiable with Organizer Tools
Thanks and Regards
SriniYes. Error says "File is not found: C:\Program Files\Microsoft\Exchange Server\V\Bin\CmdletExtensionAgents\ScriptingAgentConfig.xml"
Do you have any other Exchange server? If so, copy the file "C:\Program Files\Microsoft\Exchange Server\V\Bin\CmdletExtensionAgents\ScriptingAgentConfig.xml"
from another server to this server by creating same directory structure and try creating contact...
Blog |
Get Your Exchange Powershell Tip of the Day from here -
Bank Analyzer - Error while creating the Position Structure
Hi,
We are implementing Bank Analyzer 6.0 and Implementing Financial Instrument and Financial Transaction.
We facing an Error while creating the Position Structure,
Error Message: Status of structure S40CURRACC is "New"
Anyone has an idea how to fix this?
Thank you,
John CrawfordHi,
1.Run Transaction - /BA1/F0_SGS_START
2.Entered the name of the structure and try to "activate".
3.It will get Active without any inconsistency.
Regards
Phani -
Creating a new Structure in SAP
Dear all,
I am patching a BAPI and need to create a new structure BAIPKOMFKTX as instructed by SAP Note 581263.
The instructions are clear except that it does not indicate what delivery class to use for this new structure. Could anybody please advice what delivery class to use? Should I use delivery class 'S' - System Table, Maint only by SAP, change = modification
Best Regards,
JunwenHello Klaus,
Thank you for pointing this out. This was my first attempt at creating a structure. After exploring with the various options in SE11, it seems i should create a 'structure' by selecting the radio button 'DataType'.
Best Regards,
Junwen -
Is there an app for creating a folder structure on the iPhone out there?
I'm looking for an application to create folders (possibly password-protect them) on the iPhone, so I can add documents, PDFs, video clips etc to the phone and create subdivide them further in folders. There doesn't seem to be anything that does the right job in the app store. Is it not possible? Any feedback to help me understand would be appreciated.
It is not possible. You cannot create the folder structure you're speaking of and you cannot save files to your iPhone, even if you had folders.
There are no apps for folders or app organization. There are apps that allow you to access files from your desktop or the cloud from your iPhone. I use box.net. Dropbox and AirShare are others. -
How create an xml structure in a pdf form
Hi genius guys,
some one can help me to create a correct xml structure (root, subroot1, subroot2, etc etc) in a pdf form and not only the single tag?
Example: I give a pdf with form to be filled and after I extract xml data. Now I have this:
<?xml version="1.0" encoding="UTF-8"?>
<fields xmlns:xfdf="http://ns.adobe.com/xfdf-transition/"
><A1classe
>1995</A1classe
><A1cognome
>Fanna</A1cognome
><A1nome
>Tonino</A1nome
><Annodifondazione xfdf:original="Anno di fondazione"
>1965</Annodifondazione
><C1classe
>1976</C1classe
><C1cognome
>Di Gennaro</C1cognome
><C1nome
>Antonio</C1nome
><Campionato
>ECCELLENZA</Campionato
><Campodigioco
>Comunale di Villabartolomea</Campodigioco
><Colorisociali
>Giallo Rosso</Colorisociali
><D1classe
>1984</D1classe
><D1cognome
>Fontolan</D1cognome
><D1nome
>Beppe</D1nome
><Girone
>A</Girone
><P1classe
>1980</P1classe
><P1cognome
>Zoff</P1cognome
><P1nome
>Dino</P1nome
><P2classe
>1974</P2classe
><P2cognome
>Garella</P2cognome
><P2nome
>Claudio</P2nome
><S1cognome
>Baudo</S1cognome
><S1mansione
>Presidente</S1mansione
><S1nome
>Pippo</S1nome
><S2cognome
>Togni</S2cognome
><S2mansione
>Vice Presidente</S2mansione
><S2nome
>Darix</S2nome
><Sede
>Via Pisacane,8 - Villabartolomea</Sede
><Squadra
>VILLABARTOLOMEA</Squadra
><T1cognome
>Dallara</T1cognome
><T1mansione
>Allenatore</T1mansione
><T1nome
>Toni</T1nome
><T2cognome
>Silvan</T2cognome
><T2mansione
>Magazziniere</T2mansione
><T2nome
>Mago</T2nome
></fields
>
and I need this:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xfdf="http://ns.adobe.com/xfdf-transition/"
><attaccanti>
<A1classe
>1995</A1classe
><A1cognome
>Fanna</A1cognome
><A1nome
>Tonino</A1nome
>
</attaccanti>
<Annodifondazione xfdf:original="Anno di fondazione"
>1965</Annodifondazione
>
<centrocampisti>
<C1classe
>1976</C1classe
><C1cognome
>Di Gennaro</C1cognome
><C1nome
>Antonio</C1nome>
</centrocampisti>
<Campionato
>ECCELLENZA</Campionato
><Campodigioco
>Comunale di Villabartolomea</Campodigioco
><Colorisociali
>Giallo Rosso</Colorisociali
>
<difensori>
<D1classe
>1984</D1classe
><D1cognome
>Fontolan</D1cognome
><D1nome
>Beppe</D1nome
></difensori>
<Girone
>A</Girone
><portieri>
<P1classe
>1980</P1classe
><P1cognome
>Zoff</P1cognome
><P1nome
>Dino</P1nome
><P2classe
>1974</P2classe
><P2cognome
>Garella</P2cognome
><P2nome
>Claudio</P2nome
></portieri>
<societa>
<S1cognome
>Baudo</S1cognome
><S1mansione
>Presidente</S1mansione
><S1nome
>Pippo</S1nome
><S2cognome
>Togni</S2cognome
><S2mansione
>Vice Presidente</S2mansione
><S2nome
>Darix</S2nome
></societa>
<Sede
>Via Pisacane,8 - Villabartolomea</Sede
><Squadra
>VILLABARTOLOMEA</Squadra
><tecnici>
<T1cognome
>Dallara</T1cognome
><T1mansione
>Allenatore</T1mansione
><T1nome
>Toni</T1nome
><T2cognome
>Silvan</T2cognome
><T2mansione
>Magazziniere</T2mansione
><T2nome
>Mago</T2nome
>
</tecnici></root
>
Thanx, PaoloI solve the trouble using "." to separate the tagname and create the correct structure for xml.
example:
team.player.1name
team.player.1surname
team.player.1rol
team.player.2name
team.player.2surname
team.player.2role
this give me:
<team>
<player>
<1name>XXXX</1name>
<1surname>YYY</1surname>
<1role>forward</1role>
</player>
<player>
<2name>XXXX</2name>
<2surname>YYY</2surname>
<2role>forward</2role>
</player>
</team> -
Create transformation from structure
HI,
There is option to create simple transformation structure on transction STRANS
and move the structure to internal table ?
any simple example will help i need to do poc for that ,
Thanks in advance
Alex
Edited by: Alex Dean on Mar 25, 2010 1:07 PMHI
I am familiar with the option to transfer abap table to XML via TR.STRANS
and call transformation but i am not familiar how to do the opposite i.e. create structure
in TR. STRANS and transfer it to internal table .
Regards
Alex -
How do I create a physical structure in the data dictionary ?
Hi all,
How can I create a data structure using ABAP ? (prefrebly by using a class)
I want to create a physical data dictionary structure, just like using se11 (data type -> structure).
Thanx ahead.
-TonniTo create a dynamic table at runtime I use the code below.
DATA: gt_fcat TYPE slis_t_fieldcat_alv,
gs_fcat LIKE LINE OF gt_fcat,
gt_fieldcat TYPE lvc_t_fcat,
gs_fieldcat LIKE LINE OF gt_fieldcat.
CLEAR: gt_fieldcat, gt_fieldcat[], gs_fieldcat.
gs_fieldcat-fieldname = 'SIGN'.
gs_fieldcat-ref_field = 'XMSTU'.
gs_fieldcat-ref_table = 'T007A'.
gs_fieldcat-fix_column = space.
gs_fieldcat-no_zero = space.
APPEND gs_fieldcat TO gt_fieldcat.
gs_fieldcat-fieldname = 'OPTION'.
gs_fieldcat-ref_field = 'SEQN'.
gs_fieldcat-ref_table = 'T159W'.
gs_fieldcat-fix_column = space.
gs_fieldcat-no_zero = space.
APPEND gs_fieldcat TO gt_fieldcat.
Create a new Table
CLEAR : gt_range2.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fieldcat
IMPORTING
ep_table = gt_range2.
Create a new Line with the same structure of the table.
ASSIGN gt_range2->* TO <range>.
To create a structure like this table I use
CREATE DATA gs_range2 LIKE LINE OF <range>.
ASSIGN gs_range2->* TO <range1>. -
To create a deep structure for dynamic internal table.
Hello
My ALV has fields which are defined dynamically during execution.
so, i did it in the following way,
Declared Field symbolds, DREF and fieldcatalog as,
FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,
<fs_dyntable>.
DATA: dref_dyntab TYPE REF TO data,
dref_dynwa TYPE REF TO data.
DATA: ts_fieldcatalog TYPE lvc_t_fcat.
DATA: wa_fieldcatalog TYPE lvc_s_fcat.
Updated Fieldcatalog dynamically as,
*function module to read segment structure
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = v_segment_name
TABLES
segmentstructure = ts_seg_structure
EXCEPTIONS
no_authority = 1
segment_not_existing = 2
OTHERS = 3.
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN '1'.
MESSAGE e024.
STOP.
WHEN '2'.
MESSAGE e025 WITH v_segment_name.
STOP.
WHEN OTHERS.
MESSAGE e023.
ENDCASE.
ENDIF.
*FETCH FIELDS FROM STRUCTURE OF SEGMENT AND CREATE FIELDCATALOG FOR
EACH FIELD OF SEGMENT (DYNAMIC FIELD CATALOG)
LOOP AT ts_seg_structure INTO wa_seg_structure.
ADD 1 TO v_counter.
wa_fieldcatalog-fieldname = wa_seg_structure-fieldname.
wa_fieldcatalog-col_pos = v_counter.
wa_fieldcatalog-ref_table = wa_seg_structure-segtyp.
APPEND wa_fieldcatalog TO ts_fieldcatalog.
CLEAR wa_fieldcatalog.
ENDLOOP.
and generated dynamic internal table using fieldcatalog as,
*--Method to get the structure of table using fieldcatalog.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ts_fieldcatalog
IMPORTING
*--Variable of type REF TO DATA.
ep_table = dref_dyntab.
IF sy-subrc <> 0.
MESSAGE e023.
ENDIF.
*--Dynamic internal tables required when show segments selected
IF p_selseg IS NOT INITIAL.
ASSIGN dref_dyntab->* TO <t_dyntable>.
*--Create dynamic work area and assign to FS
CREATE DATA dref_dynwa LIKE LINE OF <t_dyntable>.
ASSIGN dref_dynwa->* TO <fs_dyntable>.
And then i populated this <t_dyntable> which is being passed as data-table to method
CL_GUI_ALV_GRID => SET_TABLE_FOR_FIRST_DISPLAY
for ALV grid Display along with above used filedcatalog ts_fieldcatalog.
Things are fine till here, but now i have the requirement to edit selected rows of the ALV display..
As you might be aware, we need a field
TS_STYLEROW TYPE lvc_t_styl, (i.e, a field of type 'h' and we can say as an internal table inside an internal table or else as a deep structure)
in the output internal table <t_dyntable> to meet our requirement.
My issue is about declaring one such field of type 'h' in this dynamically created internal table ''<t_dyntable>".
I tried in the following way by adding one such field to fieldcatalog :
*Field for Styling
ADD 1 TO v_counter.
wa_fieldcatalog-fieldname = 'TS_STYLEROW'.
wa_fieldcatalog-tabname = 'TS_STYLE'.
wa_fieldcatalog-col_pos = v_counter.
wa_fieldcatalog-no_out = 'X'.
wa_fieldcatalog-inttype = 'h'. " I even mentioned this
APPEND wa_fieldcatalog TO ts_fieldcatalog.
CLEAR wa_fieldcatalog.
But this is creating a field of type 'C' in the table <t_dyntable> instead of what i was expecting
Guyz and respected,
Please advice me with the solution or ur ideas....
Note : The overall requirement is create a deep structure for dynamically generated internal table.
Your help is highly appreciated and unforgettable..!!!!!!!hi,
Dynamic append
Dynamic internal table
Dynamic internal table
dynamic columns in ALV
Variant for dynamic selection
thanks -
How to create a info structure for product allocation functionality
Hi Experts,
how to create a info structure for product allocation functionality
For allocating fixed quantities to the specified customers at sales order
Especially i need help in selecting the key figures and key charecterstics for at mc21 and mc24 t.codes(source feilds)
plase provide product allocation functionality with screenhots
thanks in advance
rp
Edited by: rajendraprasad vasam on May 21, 2008 2:19 PM
Edited by: rajendraprasad vasam on May 21, 2008 2:19 PM
Edited by: rajendraprasad vasam on May 21, 2008 2:20 PMHello,
please have a look at the infostructure S140 in transaction MC23 and MC26.
this is the standard infostructure for product allocation.
I hope that the information are helpful.
Regards
Claudia -
How to find key figures not created in a Structure.
After using Where Used on a selection variable Z_FISCPER3_M_SV a list of Key Figures appear. I wish to amended these Key Figures as the selection variable used is incorrect. However, I cannot find these Key Figures in the Structure? Does anyone know how to find Key Figures not created in a Structure.
Thanks for such a quick response.
I am assuming the following about the table :
- Column u201CCALDAYu201D contains a date value for each day the Index is active.
- Column u201CBIA_USEDu201D contains a value that is iterated for the given day each time the Index is used.
- Column u201CBIA_NOTPOSSIBLEu201D contains a value representing how many times a query could not access this Index.
- Column u201CNO_BIAu201D tells if a BWA Index exists at all on any of my BWA Blades
- Column u201CBIA_TECHINAu201D ????????
- Column u201CBIA_INAu201D ???????
- Column u201CDB_FALLBACKu201D ???????
I am not sure if my understanding of the column is correct. Can you tell me they are? The columns with u201C???????u201D mean I have no solid understanding of how to use these columns at all.
Thanks
Maybe you are looking for
-
Default video sound is mute. But when i also can turn on from the volume bar.
I use FLVPlayback from CS 4 to input videos. I need default sound is mute, but I can turn it on when I need it from volume bar. Please see my attachement: Here is the AS: stop(); button1.addEventListener(MouseEvent.CLICK,clickListener1); function cl
-
Materialized views performance gain estimation
Hi; I have to estimate the performance gain of a materialized view for a particular query without creating it. that means, i have: - A query with initial execution plan - A select statement with is considered as a probable MV i need to show what is t
-
How do you save a masked product shot for a printed catalog?
I have some catalog and packaging work and my graphic artist is on vacation (honeymoon) so I am on my own. I have masked a photographic image, what I can't seem to do is save it as a jpeg without saving the background color which is usually white. I
-
Alternatives to load stylesheet...
Hi, I need to be able to swap out styles en masse across the whole application in a mobile project. Obviously, that would be easy anywhere else... styleManager.loadStylesheet or similar. But in mobile... I think I am resigned to compiling a single, b
-
Consolidation with local Account
Hi I have a question about the consolidation with local accounts, we have subsidiaries in Latinoamerica in countries like chile, peru, colombia, and our users in this countries want to prepare financial statements but with local account and then send