For example:
userProxyAddresses = $srcObj["proxyAddresses"]
Although proxyAddresses is a multi-valued attribute, the userProxyAddresses variable will be assigned only one value.
This is by design. The $srcObj and $dstObj objects are designed specifically to query for/return single values.
WORKAROUND 1
Use the $commonParameters object to return all values of a multi-valued attribute.
Instead of $srcOjb use $commonParameters.CommonVars.SourceObject.Attributes["attribute"].Values
Instead of $dstOjb use $commonParameters.CommonVars.TargetObject.Attributes["attribute"].Values
The following sample script captures all of the values stored in the proxyAddresses attribute and writes them to a log file:
$logfile = "C:\Temp\QC-proxyAddresses_Debug.txt" $message = "proxyAddress processing started for " + $srcObj["mail"] Add-Content $logfile $message $strValue = $commonParameters.CommonVars.SourceObject.Attributes["proxyAddresses"].Values $message = "proxyAddress value in sourceObject is: " + $strValue Add-Content $logfile $message $index = 0 foreach ($Address in $strValue) { $message = " value " + $index + ": " + $Address Add-Content $logfile $message $index++ $return = $return + $Address + "||" } $return = $return.TrimEnd("||") $return WORKAROUND 2
In a related issue, values in a CSV file may be mistakenly split into multiple elements if the value contains commas. For example, a "Job Title" may contain a value of "Associate, Sales Department". $srcObj["Job Title"] may return a value of "Associate" or " Sales Department" The workaround for this is to use the $commonParameters object to return the split values and then join them using a comma.$strValue = $commonParameters.CommonVars.SourceObject.Attributes[
"Job Title"].Values $joinedStr = $strValue -join "," return $joinedStr
© 2024 One Identity LLC. ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center