You can edit Multi Value Attributes with the PowerShell.
But if you use the usual techniques, existing content will be deleted.
Some small changes in the script line are the solution.
In a current project we want to use a CustomAttribute for the migration management. The different migration phases are saved with a Multi Value Attribute and trigger different processes in dependence of the values. For an AD Migration it is really great to have PowerShell and Multi Value Attributes do work together.
All values of the Multi Value Attribute are deleted
When you try to store a new value to a Multi Value Attribute with the usual techniques, the existing content will be erased.
This line writes the value “phase1“ into the attribute msExchExtensionCustomAttribute1:
This example overwrites all the content, “phase1“ is replaced by “phase2“:
Add or delete values without problems
With a small change in the script line, you can easily achieve that values are added or single values are deleted:
Adds one or more values
Deletes one or more values
Deletes all values
Deletes all values and writes new ones
The following line adds the value “phase2” to an existing one
If you are little used to PowerShell, you can also delete values based on search criteria:
The example searches for values containing “New” while not paying attention to upper or lower case spelling (newvalue, NewValue, etc.).