ESM PS Evaluate - Survey Sent Pass Fail

Modified on Wed, 19 Jan, 2022 at 12:14 PM





#Run the powershell script with a param from esm. the survey ID is required.
$Surveys = Get-MSSurveysForModuleItems -Module UserMigrations -SurveyId $scriptArgs.UserInput -InstanceIds $ScriptArgs.Items -Full

$Results = @()

Foreach($Survey in $Surveys){

    If($Survey.RequestEmailSent -eq $true){
            $results += New-Object PSObject -Property @{
            InstanceId = $Survey.InstanceId;
            ResultHeader = "User has been sent the Survey called `"$($Survey.SurveyName)`" ";   
            ResultStatus = "Success"}
                }
    Else{$results += New-Object PSObject -Property @{
            InstanceId = $Survey.InstanceId;
            ResultHeader = "User has NOT been sent the Survey called `"$($Survey.SurveyName)`" ";   
            ResultStatus = "Error"}    

                }

    }


$results



Evaluate Function - The criteria should be the survey ID


Further Support

If you require further support, please visit ManagementStudio's Service Desk to search the knowledge base or create a new support ticket.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article