Change Workflow and Powershell

Hi,

I have an Active Roles workflow which gets triggered when an attribute of a user gets changed. The name of my workflow is "Test". Now I want to execute a PowerShell script when such an event takes place. After looking at the SDK the syntax I would need to use is "$workflow.ActivityTarget (name)".

The line I used is "$User = $workflow.ActivityTarget("Test").get("distinguishedName")" but the error message I receive through checking the Change History is "You cannot call a method on a null-valued expression."

Does anyone know how to resolve this?

Thanks.

Sander.