MID Server Script Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 06:53 AM
Hello All,
i am having difficult time to understand how inputs in a power shell custom activity is getting passed to MID Server Script file; and how can we define a environment variable like i have seen in few OOB scripts, refer below -
if (test-path env:\SNC_groupname) {
$groupname = $env:SNC_groupname;
$username = $env:SNC_username;
};
Regards, Bharat
- Labels:
-
Orchestration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 06:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 07:29 AM
Below is the MID Server script for AddUserToADGroup.ps1
import-module "$executingScriptDirectory\AD\ActiveDirectory"
if (test-path env:\SNC_groupname) {
$groupname = $env:SNC_groupname;
$username = $env:SNC_username;
};
SNCLog-ParameterInfo @("Running AddUserToADGroup", $groupname, $username)
addADUserAccountToGroup -domainController $computer -username $username -groupname $groupname -useCred $useCred -credential $cred
# here $computer,$userCred and $cred isnt defined; and how environment variables are defined ?
Thanks in advance !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 02:59 PM
you will pass them from the custom pack, if you are using a workflow.
add groupname and username in the name column of the powershell variables. The same can be done with flow designer