How to Bulk Lock a Survey (or Unlock)

Modified on Tue, 26 Mar 2024 at 05:20 PM

TABLE OF CONTENTS

Introduction

The ability to lock a survey allows administrators to stop end-users from submitting or continuing with their survey until further notice. A survey lock (or unlock) can be applied to or removed from surveys individually, in bulk or through the use of automation. This article outlines the steps required to bulk lock a survey within the User Migrations module. This approach applies to the other modules in ManagementStudio. Here's an article on how to unlock a Survey.



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 lock 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 XX 

 
  • Note that the -UnLock switch can be added to the PowerShell script to unlock a survey for all users
  • Click OK (4).
  • Enter the following within the specified columns


ColumnsDetails
Script NameLock Validation Survey - Any name can be used
EnabledTicked
CategoryInternal -Lock survey
DescriptionScript to lock 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 Lock Script

  • Switch to Administration>User Migrations>UI Buttons (1).
  • In the screenshot below, the target survey is the User Validation 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 (1) you would like to lock their surveys on the grid.
  • Right Click and select Surveys(2)->The target survey (3)>Survey button (4) 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.