I have a few scripts i need to run in a workflow but I need to pass the username from the search function of work flow
$filerpath = '\\folder\homefolder123
New-Item -Name $username -ItemType Directory -Path $filerpath
Active Roles has an SDK file with a section titled "Retrieving data from workflow context". It details how scripts can access data from various types of workflow steps, one of them being "FoundObject". You can retrieve the distinguishedname of a found object by running the following statement from a script that is executed by a workflow:
FoundObjDN = $workflow.FoundObject("<name of Search workflow step>").get("distinguishedName")
Data that is saved in 'Save Object Properties' workflow steps can also be retrieved.