onPostModify Is there a way to retrieve a list of all attributes that were modified?

I attempted to use $Request.RequestedAttributes in the script but onPostModify this is blank. I've looked through the SDK and Sample Scripts on the oneidentity website and haven't found anything that does this. Does anyone have any ideas?

I just need to retrieve the names of the attributes that were modified on an object.

  • Hello, search the SDK for "in-process property values" and select the IADsPropertyList topic. You will find a sample onPreModify script that enumerates the attributes that are modified in the Request. This might work as well in onPostModify, but it would need to be tested.

  • IEDSRequestedAttributes, per the SDK, is only implemented in onPreGet, onPostGet, and onPreSearch.

    Instead, I typically use something like this to convert from the IADsPropertyList, that Richard mentions, to a standard PowerShell hashtable.

    $propertyBag = @{}
    for ($i=0; $i -lt $request.PropertyCount; $i++) {
        $null = $propertyBag.Add($request.Item($i).Name, $request.Get($request.Item($i).Name))
    }

    I have adopted this because IADS::Get will generate a terminating error if you attempt to get a property that does not exist in the $Request object. To whit, if you call $request.Get("description") but the "description" attribute was not modified, the script will generate a terminating error. Solution to that would be to either wrap $request.Get in a Try/Catch block, or to avoid the problem by only calling $request.Get on attributes you know are modified because they are listed in the IADsPropertyList enumeration. Want to know if description was modified? With the hashtable, you can just call $request.ContainsKey("description") and get a $true or $false back without risk of a terminating error.