Updating file attributes with vb

This script can be used to update Active Directory User attributes from a CSV file.One column in the CSV file is used to match rows in the CSV file to user accounts in Active Directory and the other columns are used to update attributes.The cn (common name) forms part of an objects distinguished name.

Normally the Pre-Windows 2000 username (s AMAccount Name) attribute is used to match rows in the CSV file to user accounts in Active Directory, but you can easily modify the script to use a different attribute if required.For example, you might want to identify the user account you want to update in the CSV file by email address (mail attribute) rather than username.See here for more information on producing CSV files.As well as taking care to ensure that the CSV file you have produced is valid, you also need to ensure that the CSV file includes a header row.Also, it's a good idea to have a plan of action prepared should something go wrong with the update.

Taking a backup of your Active Directory database is a sensible precaution, and it also pays to be familiar with backup and restore techniques.If you have a large domain or a domain that is connected over slow WAN links, you might also need to consider the impact of replication traffic when performing bulk updates.Bulk updates can save an enormous amount of time and they normally run very smoothly if planned correctly.If you don't want to edit the script, the CSV file should be called "usermod.csv" and it should be located on the root of the "C:\" drive.If you want to use a different filename or location, edit the if you want to use a different attribute for matching rows in the CSV file to users in Active Directory (e.g. The attribute you choose for the str Search Attribute should be unique as the script expects a maximum of 1 user to be returned for any attribute value.This attribute can be read the same as any other attribute, but to change the value you need to use the "Move Here" method.