How to Bulk Unlock and Reset the Email Stats against Survey

Modified on Tue, 15 Feb 2022 at 01:07 PM

TABLE OF CONTENTS

Introduction

The Survey is used to engage with the end-users to gather information and feedback. During a project lifecycle, a project coordinator might have mistakenly sent out a survey to a list of Users within the organisation and the User's survey subsequently locked after they have submitted the survey. This article will outline the steps required to bulk unlock a user's survey using a custom PowerShell script.


Step 1 - Determine 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).

Step 2 - Configure the PowerShell Script

Create a PowerShell script to unlock & reset the email stats of the target survey.


  • Switch to Administration>PowerShell Scripts (1).
  • Click on Click here to add new item (2).

  • Enter a script name.
  • Click on the Edit (3) symbol and enter the following script.
  
Please change the survey id to match the id noted in step 1


  Update-MSLockSurveyForModuleItems -InstanceIds $ScriptArgs.Items -Module UserMigrations -SurveyId 9 -UnLock

Reset-MSSurveyEmailStatsForModuleItems -InstanceIds $ScriptArgs.Items -Module UserMigrations -SurveyId 9

 
  • Click OK (4).
  • Enter the following within the specified columns


ColumnsDetails
Script NameSurvey unlock - Any name can be used
EnabledTicked
CategoryInternal -Unlock survey
DescriptionScript to unlock a specified survey
Click Edit to edit the PowerShell scriptPaste in the script. See note above for changes that are required.
ModuleUser Migrations
Run AsApi Account
Grant AccessPower User role group or the role group of users you wish to grant access to be able to run this script.


  • Click Save Changes (5).

Step 3 - Configure the UI Button to Run the Unlock Script

  • Switch to Administration>User Migrations>UI Buttons (1).
  • In the screenshot below, the target survey is the Office 365 Migration Survey.
  • Click on the Plus (2) symbol next to the target survey.
  • Enter the Name of the Button label, select the Grant access 1 level from the dropdown menu (3).
  • Select the Script name within the Run Script column(3).
  • Click Save Changes (4).

  • Click on Restart.
  • Switch to the User Migrations module.
  • Select the Users you would like to unlock their surveys on the grid.
  • Right Click and select Surveys->The target survey>Survey button created.
  • Click Continue to confirm.



  • Within a few minutes, there will be a message displayed 'Survey Lock 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.