Hello everyone!
I have the following strange behavior with Søren Granfeldt PowerShell MA on Export:
I am using CSEntryChange objects on Export, so i want to determine only changed values in multivalue attributes.
Here is the example of export:
To display changed values in debug file i am using following powershell code:
$atrChng = $_.ChangedAttributeNamesforeach ($can in $atrChng)
{
"Name: $can" | Out-File $DebugFile -Append
foreach ($ValueChange in $_.AttributeChanges[$can].ValueChanges)
{
$val = $ValueChange.Value
$valmodt = $ValueChange.ModificationType
"Value: $val $valmodt " | Out-File $DebugFile -Append
}
}
In my debug file i have the following result:
Name: membersValue: u6000041 Add
Value: u6000042 Add
Value: u6000048 Add
This means that all attributes, even those that not have been changed are display as added attributes.
I have an idea that this behavior is because of Object Replacement type export of this MA. If i am right, does this mean, that there are no ways for me to get only changed values instead of sort out all of them? In my case i should exactly know changed values to execute the target system API functions AddUserToGroup() or DeleteUserFromGroup() for each.
The other option is that i am doing something wrong :)
Thanks in advance for any help!