- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2014 09:02 AM
I have a PowerShell MID Server Script file, Out-MyNameIs.ps1:
[CmdletBinding()]
Param(
[string]$name
)
Write-Output "%%MyNameIs%%"
Write-Output "$($name)"
Write-Output "%%"
I expect the Output of a Run PowerShell workflow activity to look like this:
%%MyNameIs%%
Chad
%%
In the activity, I have selected Out-MyNameIs.ps1 in the Script file field. Since my script requires the $name parameter, I have created a simple JSON string to put in the PowerShell script variables field:
{
"name" : "Chad"
}
I have replaced "name" with "$name" and "powershell_name"(based on comment in Run PowerShell activity definition), and have changed the $name parameter in the script to $powershell_param_name as it appears in the ecc queue:
<parameter name="powershell_param_name" value="Chad"/>
So far, all I have seen is:
%%MyNameIs%%
%%
Has anyone any experience with using PowerShell script variables that can help me get this working?
Thanks,
Chad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2014 07:38 AM
Chad,
I found solution for this, it looks like below.
In your workflow you should pass name as :
"name": "${your variable here if dynamic}"
and in powershell
$localVar = $env:SNC_name; // this is your workflow var
Thanks,
Kartheek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 06:22 AM
If I had the time... Start building it and invite me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2015 09:27 AM
How to Setup an Orchestration PowerShell Activity in a Workflow
I've uploaded a video to do a quick run-through of setting up a PowerShell activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2015 05:04 AM
Thanks buddy!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2016 10:05 AM
Hi Tim,
Thanks for the video you created it was a great help learning how to use PS activity in a workflow. I have a question. I have a requirement from customer to automate the creation of Distribution Group with multiple Owners and Members. I tried creating the DG like this: New-DistributionGroup -Name $groupName -ManagedBy $groupOwners -Members $groupMembers -CopyOwnerToMember
The variables are passed from the Run Powershell Activity of the Workflow.
$groupName = <name of DG>
$groupOwners = 'User 1','User 2','User 3'
$groupMembers = 'Member 1','Member 2','Member 3'
Somehow that did not work so I create 3 PS script files.
1. Create the DG - Was successfully able to create the DG
2. Add Owners - Was not successfully able to add Owners.
3. Add Members + Owners - Was successfully able to add Members + Owners
The syntax I used to add the Owners: Set-DistributionGroup -Identity $groupName -ManagedBy $groupOwners
It gives an error: Couldn't find object "''User 1'',''User 2''". Please make sure that it was spelled correctly.....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2016 02:40 PM
Syap,
It's good that you broke the functionality out into different parts. Keeping the pieces simple and reusable are a key to good programming.
The syntax that you provided looks correct for adding the Owners. Make sure every user in the Owners list actually resolves to a mailbox. You could try wrapping the entire Owners list in double quotes while each user is in single quotes.
Tim