Update an attribute of all entries

Home | Tutorials | Compare


This tutorial explains how to update an attribute of all entries within a container. To run update statement first connect to the directory server ((To create a new connection please see Connecting to Active Directory remotely )

After successful connection, select the SQL button from the top menu, this will open the sql tab where you can enter the sql statements. You can also create simple sql statement from the right click context menu (Bottom tree pane).



To create a simple sql statement to update all records within a container, Select entry and from right click context menu select 'Update this record and all Children)


Ctrl+v (or paste) to paste the data to the sql window modify the attribute to update, for e.g. to update postalcode to 60660, modify the statement to

UPDATE CN=Users,DC=ldapsoft,DC=local SET

Change the maximum results to number of records expected or '0' for unlimited. Click 'Run' to run the statement.


active directory run update statement


When you run the statement, A Status dialog will appear which provides the following information

Number of entries to be updated
Status of each entry (Whether the entry update was successful or not)
Total status (how many succeeded how many failed)

Verify the entries to update and click 'Yes'


Active Directory run update


The Update Status dialog also gives you the ability to skip all errors or abort the operation after an error.



Warning: Don't run the update statement on attributes with multiple values as it will replace the attribute with new single value. For multiple value please use UpdateReplace statement (For syntax and more information please see the product documentation - search for 'updatereplace' and also 'Difference Between Update, UpdateAdd & Update Replace Statement')

See Also:
Query Active Directory using Select Statements
Update Active Directory entries using where clause