PowerShell Connector Export Changes Operation

Overview

There are three types of operations that may be performed when exporting changes to the target system. These are Add Entities, Update entities and Delete entities.

Implementation

Each of the export operations serve a different purpose, but their underlying implementations are very similar. At their core, each operation provides you with a series of entities to process:

$components.InputEntities

This is an IEnumerable of entities to be processed. An example usage might be iterating through each individual entity:

ForEach ($entity in $components.InputEntities)
{
     # Add, Update or Delete the entity.
}

When updates are performed, the script has access to a set of the previous known state of the objects in:

$components.OriginalEntities

which can be iterated or queried against:

ForEach($entity in $components.OriginalEntities)
{
    # Do something with $entity
}

Some values may only be available after the object has been added. For example objectGUID in Active Directory. You can set the value on the entity and it will be saved to the connector context:

$sAMAccountName = $entity['sAMAccountName'];
Add-To-ActiveDirectory -account $sAMAccountName;
$objectGUID = Get-Object-Guid -account $sAMAccountName;
$entity['objectGUID'] = $objectGUID;

Is this article helpful for you?