This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need to find out all attributed modified in function onPreModify

Hi all!

I need to dynamically find all attributes modified in function onPreModify($Request).

I do NOT want to something like:

function onPreModify($Request)

{

if ((IsAttributeModified "edsva_myattribute" $Request) -eq $true)

        {
            #do something like mail info someone that a attribute "edsva_myattribute" changed for a certain user to a certain value
        }

}

 

rather I like to have:

function onPreModify($Request)

{

$attributeschanged = $request.thefuntionIlookfor() #give me a list all attributes changed 

foreach($attribute in $attrubuteschanged)

{
 
#do something like mail info someone these these x number of attributes changed for a certain user and the new values was x,z,y

}

Cant find that scenario in articles, maybe someone else has?

Best regards,

//Johan Salomonsson

Parents
  • Hi Johan,

    This can be accomplished using the following:

    function onPreModify($Request)
    {
        $Request.Attributes.Attributes | %{
            $_.Name | Out-File -FilePath "C:\Temp\AttributeNames.txt" -Append
        }
    }


    That will output all modified attribute names to the text file. Please modify it appropriately for your use case. I hope this helps.

Reply
  • Hi Johan,

    This can be accomplished using the following:

    function onPreModify($Request)
    {
        $Request.Attributes.Attributes | %{
            $_.Name | Out-File -FilePath "C:\Temp\AttributeNames.txt" -Append
        }
    }


    That will output all modified attribute names to the text file. Please modify it appropriately for your use case. I hope this helps.

Children
No Data