PowerShell Custom Activity

Hello,

i am new to password manager and are looking on an how to remove a user from a group during a workflow.

But how to know about the user that is currently running the workflow so that i can use, for example, the samaccountname for my script?

I tried the following but getting an error message in the log.

$username = $Request["Username"]

remove-adgroupmember "groupname" -member $username -confirm:$false

It seems to be, that the varialbe $username is empty.

Thanks

Frank

Parents
  • Hello Richard,
    no, i was not able to figure out how it is working. Your example is good, but i did not have the Roles Server running. And only with the powershell snapins, i could not get the username.

    I try to use the SDK help, but i did not get it. I try to use the example on the powershell handlers for custom web services to get the actual user who is running the workflow. But it is not working. I am sure that i am doing something wrong. But i did not get it.

    I am using the following example code:

    $username = $Request[“UserName”]

    if (“$username” –eq “”) {
    $Response.Write(“What is your username?”);
    } else {
    $Response.Write(“Hello, $username!”);
    }

    But the username is empty.
    Frank
Reply Children
No Data