TABLE OF CONTENTS
Introduction
This article will outline the steps required to change the Survey status (Pass, Fail, Incomplete) against a User or group of Users on the grid from the right click context menu.
Step 1 - Establish the Survey Id for the Survey
- Switch to Administration>User Migrations>Surveys (1).
- Select the survey from the dropdown menu (2).
- Click Settings (3).
- Make a note of the Survey id (4). Eg 16 in the screenshot below.
Step 2 - Configure the PowerShell Script
Create a PowerShell script to change the survey status
- Switch to Administration->User Migrations->PowerShell Scripts (1).
- Click User Migrations (2).
- Click on Click here to add new item (3).
- Enter the Script name (1).
- Click on the PowerShell Editor icon(2).
- Enter the following script:
$surveys = Get-MSSurveysForModuleItems -Module UserMigrations -SurveyId $ScriptArgs.EventArg2 -InstanceIds $ScriptArgs.Items
foreach($survey in $surveys)
{
If($ScriptArgs.EventArg1 -eq 'Pass'){$survey.CompleteResult = $True; $survey.CompletedBy = $ScriptArgs.RanByUser}
If($ScriptArgs.EventArg1 -eq 'Fail'){$survey.CompleteResult = $fail; $survey.CompletedBy = $ScriptArgs.RanByUser}
If($ScriptArgs.EventArg1 -eq 'Incomplete'){$survey.CompleteResult = $null; $survey.CompletedBy = $ScriptArgs.RanByUser}
}
Update-MSSurveysForModuleItems -Module UserMigrations -SurveyReults $surveys
- Click OK (3).
- Enter the following within the specified columns
Columns | Details |
Script Name | Override Survey Status - Any name can be used |
Enabled | Ticked |
Category | Survey - Any category can be used |
Description | Script to change the status of a specified survey |
Click Edit to edit the PowerShell script | Paste in the script |
Module | User Migrations |
Run As | Api Account |
Grant Access | Power User role group or the role group of users you wish to grant access to be able to run this script. |
- Click Save Changes (4).
Step 3 - Configure UI Button to Run the Override Survey Status Script
- Switch to Administration>User Migrations>UI Buttons (1).
- In the screenshot below, the target survey is the User Validation Survey (2).
- Click on the Plus (3) symbol next to the target survey.
- Enter the Name of the Button label (4), eg Override Survey Status. Within the Override Survey Status button, there are 3 sub-buttons.
- Click the Plus (5) symbol to add these (Pass, Fail, Incomplete) (6).
- Select the Grant access 1 level from the dropdown menu.
- Select the Script name within the Run Script column(7). This is the name of the script created in Step 2.
- Click on the Grid chooser icon located top right and enable columns Arg1 & Arg2.
- In columns Arg1, enter Pass, Fail & Incomplete against the corresponding button (9).
- In columns Arg2, enter the Survey id (10) determined in step 1 against each survey button.
- Click Save Changes (11).
Step 4 - Run the Script via the User Migrations Context Menu
- Restart the Client.
- Switch to the User Migrations module.
- Select the Users you would like to change their survey status on the grid.
- Right Click and select Surveys (1)->The target survey (2)>Survey button (3)->Sub Button (4) created.
- Click Continue to confirm.
- Within a few minutes, there will be a message displayed 'Survey Change Status Complete'.
Further Support
If you require further support, please visit ManagementStudio's Service Desk to search the knowledge base or create a new support ticket.